c#执行 update语句出错
///<summary>///修改按钮的事件///</summary>///<paramname="sender"></param>///<paramname="e"><...
/// <summary> /// 修改按钮的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { string sql = string.Format("updata Student set realName='{0}',Age='{1}',Sex='{2}',City='{3}',Grade='{4}',Date='{5}'where id='{6}'", txtEditName.Text, txtEnditAge, txtEditCity.Text, cboeEditSex.Text, cboEditGrade.Text, dateTimePicker.Value,this.Id); SqlCommand command = new SqlCommand(sql,DB .connection); int result = -1; try { DB.connection.Open(); result = command.ExecuteNonQuery(); 不知道updata语句那里错了!
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询