| .NET DotNet Forum Index » ADO .NET Forum » problems with row state... |
|
Page 1 of 1 |
|
| Author |
Message |
| אורי... |
Posted: Tue Oct 06, 2009 1:41 am |
|
|
|
Guest
|
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 : |
|
|
| Back to top |
|
|
|
| Miha Markic... |
Posted: Wed Oct 07, 2009 1:35 pm |
|
|
|
Guest
|
Can you clarify what do you want to do?
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: blog.rthand.com
"אורי" < at (no spam) discussions.microsoft.com> wrote in message
news:6ED38ABF-5D08-4765-A540-AEFF345E886D at (no spam) microsoft.com...
Quote: 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 : |
|
|
| Back to top |
|
|
|
| Montezuma's Daughter... |
Posted: Thu Oct 08, 2009 4:44 am |
|
|
|
Guest
|
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 to top |
|
|
|
|