|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to change rowstate of DataRowWhen 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? Hi,
One way would be to set myAdapter.AcceptChangesDuringFill = false; -- Show quoteMiha Markic [MVP C#] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "ad" <a*@wfes.tcc.edu.tw> wrote in message news:1131085024.919515.71840@g47g2000cwa.googlegroups.com... > 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? > |
|||||||||||||||||||||||