请问这句UPDATE语句哪里有错啊```怎么更新不了``
private void btn_Update_Click(object sender, EventArgs e){
if (txt_Control == true)
{
try
{
oleCnn.Open();
string sql = "update StudentInfo set Name='" + txt_name.Text.ToString().Trim() + "',Sex='" + txt_sex.Text.ToString().Trim() + "',Address='" + txt_addr.Text.ToString().Trim() + "',Telephone='" + txt_telephone.Text.ToString().Trim() + "',Role='" + txt_mm.Text.ToString().Trim() + "',Remark='" + txt_back.Text.ToString().Trim() + "' where StudentID=" + txt_ID.Text.ToString().Trim() + "";
OleDbCommand cmd = new OleDbCommand(sql, oleCnn);
//
cmd.ExecuteNonQuery();
MessageBox.Show("数据修改成功");
txt_Find_ID.Focus();
}
catch (Exception ex)
{
MessageBox.Show("有错误:"+ex.Message);
}
finally
{
oleCnn.Close();
}
}
else
{
MessageBox.Show("请先找出学员信息才能修改","提示");
txt_Find_ID.Focus();
}
}