这是根据序号在访问databese更新数据编码。
数据库中的整数数据类型。通过文本框输入序列号。它是在字符串数据类型。我转换成整数类型的数据,然后检查查询字符串的地方conditon。请做一些帮助。
protected void Button11_Click(object sender, EventArgs e)
{
int x;
String s;
s = TextBox1.Text;
x=(Convert.ToInt32(s));
cmd = new OleDbCommand("update userdata set firstname='" + TextBox2.Text + "', lastname='" + TextBox7.Text + "', department='" + TextBox3.Text + "', software='" + TextBox4.Text + "', hardware='" + TextBox5.Text + "' where sno='" + s +"'", con);
cmd.ExecuteNonQuery();
错误:pregt;在条件表达式中数据类型不匹配。
谢谢你,