[求助]求助:ExecuteNonQuery 错误
private void button1_Click(object sender, EventArgs e){
string connStr, insertCmd;
connStr =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=SCOREDB.mdb";
insertCmd = "Insert Into SCORE(id_no,name,chi ,eng,math) Values('" +
GetSqlStr(textBox1.Text) + "','" + GetSqlStr(textBox2.Text) +
"','" + GetSqlStr(textBox3.Text) + "','" + GetSqlStr(textBox8.Text) + "'," + CheckInt(textBox9.Text) + ")";
OleDbConnection conn;
OleDbCommand cmd;
conn = new OleDbConnection(connStr);
conn.Open();
cmd = new OleDbCommand(insertCmd, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
为什么运行的时候一直出现:标准表达式中数据类型不匹配!这个错误呢?是sql语句的问题,还是表设置的问题或者是我在TextBox上输入的有问题?
我是菜鸟,一整天都没找到答案!
请高人指教啊!