problems with row state

  • Thread starter Thread starter ×ורי
  • Start date 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 :
 
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;
}
 
Back
Top