insert语句中的sytax错误是什么 [英] what is the sytax error in insert statement
本文介绍了insert语句中的sytax错误是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我对代码进行解释时,我在插入状态中遇到了语法错误
我在哪里做错误?
when i m exuting the code i got the messg "syntax error in insert statemnt"
where i am doing mistak?
OleDbConnection connection = new OleDbConnection();
ConnectionClass cc = new ConnectionClass();
connection.ConnectionString = cc.GetConnection();
DataSet ds = new DataSet();
OleDbDataAdapter dap = new OleDbDataAdapter("Select * from EmployeeLogin", connection);
OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(dap);
connection.Open();
dap.Fill(ds, "EmployeeLogin");
DataRow dr = ds.Tables["EmployeeLogin"].NewRow();
dr[0] = txtCode.Text;
dr[1] = txtPasswrd.Text;
try
{
ds.Tables[0].Rows.Add(dr);
dap.Update(ds, "EmployeeLogin");
}
catch (Exception eee)
{
MessageBox.Show(eee.Message);
}
推荐答案
为什么不从存储过程中获取查询并检查是否存在该查询中的语法是正确的。
Why don''t you take the query from the stored procedure and check if the syntax within that query is correct.
这篇关于insert语句中的sytax错误是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文