problems with row state

  • Thread starter ×ורי
  • Start date
×

×ורי

Hi all
I have aroblem: I want to save is ms access, datatable, but all lines are
marked as new, and all the sta is re insert to the db!
when I debug I see the row state is added!(even if it is not true!!)
what can I do??


foreach (DataRow Row in ds.Tables["Tasks"].Rows)
{
switch (Row.RowState)
{
case DataRowState.Added :
 
M

Montezuma's Daughter

I want to save to the db
I want to save the changes
I tried another method
in the other way the ds is ok and the updated data is correct
the problem is there are no changes in the db, and no error msgs

OleDbDataAdapter adapter = new OleDbDataAdapter();
string queryString = "SELECT * FROM tasks";
OleDbConnection connection = new
OleDbConnection(cn.ConnectionString);
adapter.SelectCommand = new OleDbCommand
(queryString, connection);
OleDbCommandBuilder builder = new
OleDbCommandBuilder(adapter);

connection.Open();


adapter.Fill(ds.Tables["Tasks"]);

//code to modify data in dataset here

adapter.Update(ds);

return ds;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top