我想把textbox的内容提交到数据库中,但为什么数据库中不显示提交的内容呢? 这是在button按钮下写的代码
stringvalue=this.textBox3.Text;stringvalue1=this.textBox1.Text;stringvalue2=this.text...
string value = this.textBox3.Text;
string value1 = this.textBox1.Text;
string value2 = this.textBox2.Text;
string value3 = this.txbLine.Text;
string value4 = this.txbLine1.Text;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "server=.;database=RoomclassLayout;uid=sa;pwd=000000";
string sql = "insert into SelfRoom(classRoomID,DeskNo,ChairNo,DeskLin,ChairNo) values ('" + value + "','" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "')";
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Close(); 展开
string value1 = this.textBox1.Text;
string value2 = this.textBox2.Text;
string value3 = this.txbLine.Text;
string value4 = this.txbLine1.Text;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "server=.;database=RoomclassLayout;uid=sa;pwd=000000";
string sql = "insert into SelfRoom(classRoomID,DeskNo,ChairNo,DeskLin,ChairNo) values ('" + value + "','" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "')";
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Close(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询