修改数据库不成功
我先获取页面text里面的值,然后用其值作为变量更新,但不成功,请问那里出错了
string teaid=this.txtid.Text;
string teaname=this.txtname.Text:
string teaage=this.txtage.Text;
SqlConnection con=Operate.CreateConnection();
con.Open();
SqlCommand cmd=new SqlCommand("update Teacher set
TeaID='"+teanid+"',TeaName='"+teaname+"',TeaAge='"+teaage+"' where TeaID="+teaid,con);
cmd.ExecuteNonQuery();