|
-
October 29th, 2005, 09:04 AM
#1
Help. I cannot update mdb file.
I try to do it in a simple example.
File is present, opend.
Data accessable.
But no updates executed.
And runtime errors are absent too ;_(
OleDbConnection mConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\\Tmp.mdb");
OleDbCommand cmd = new OleDbCommand("SELECT t1.s1 FROM t1;", mConn);
mConn.Open();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DataRow row = ds.Tables[0].NewRow();
row["s1"] = "aaa";
ds.Tables[0].Rows.Add(row);
ds.AcceptChanges();
OleDbCommandBuilder CommandBuilder = new OleDbCommandBuilder(da);
da.InsertCommand = CommandBuilder.GetInsertCommand();
da.Update(ds,"Table");
mConn.Close();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|