How to change rowstate of DataRow

A

ad

When we create a DataSet by Select command like:
//--------------------------------------------------------------------
SqlCommand myCommand = new SqlCommand("SELECT * FROM Suppliers",
myConnection);
myCommand.CommandType = CommandType.Text;

myAdapter.SelectCommand = myCommand;
ds = new DataSet("Customers");
myAdapter.Fill(ds);
//--------------------------------------------------------------------
The RowState of every rows in the dataset is Unchanged.
I want to change the RowState of every rows to Added.
How can I do that?
 
M

Miha Markic [MVP C#]

Hi,

One way would be to set
myAdapter.AcceptChangesDuringFill = false;
 

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