运行以下代码时出现此错误
对于不返回任何键列信息的 SelectCommand,不支持为 UpdateCommand 生成动态 SQL。
尝试做很多事情都没有奏效。下面是代码
string queryUp = "SELECT Node_A_ObjectID,Node_Z_ObjectID FROM NDDILinks";
string myConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data source=D:\TiptonDB.mdb";
DataSet dtup = new DataSet();
using (OleDbConnection myConnection = new OleDbConnection())
{
myConnection.ConnectionString = myConnectionString;
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = myConnection;
myConnection.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(queryUp, myConnection);
adp.FillSchema(dtup, SchemaType.Source, "NDDILinks");
adp.Fill(dtup, "NDDILinks");
dtup.Tables[0].Rows[1][0] = 2350;
adp.AcceptChangesDuringUpdate = true;
OleDbCommandBuilder objCommandBuilder = new OleDbCommandBuilder(adp);
cmd.Parameters.Add("@Node_A_ObjectID", OleDbType.Integer, sizeof(int), "Node_A_ObjectID");
int a1 = adp.Update(dtup, "NDDILinks");
dtup.AcceptChanges();