OleDbDataAdapter只能执行select类型的查询语句吗??

2020-04-16 教育 101阅读
用法错误
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
// Create the Insert, Update and Delete commands.
da.InsertCommand = new OleDbCommand(
"INSERT INTO Customers (CustomerID, CompanyName) " +
"VALUES (?, ?)");
da.UpdateCommand = new OleDbCommand(
"UPDATE Customers SET CustomerID = ?, CompanyName = ? " +
"WHERE CustomerID = ?");
da.DeleteCommand = new OleDbCommand(
"DELETE FROM Customers WHERE CustomerID = ?");
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com