I’am using sqlserver2008.
I have a select query
Con.Open();
String MyQuery="Select * from MyTable where MyField1 is not null";
MySQLDataAdapter=New SqlDataAdapter(MyQuery,Con);
MySQLDataAdapter.Fill(MyTable);
Con.Close();
For (int I1=0;I1<=50;I1++)
{
DataRow DRw = MyTable.NewRow();
MyTable.Rows.Add(DRw); //Null Columns are added
}
blah...blah...blah..
//For Save
MyWMSDatas.VehDAp.Update(MyTable);
Now what I need that, I want ro raise the SqlDataAdapter.RowUpdating()
and would like to update while myField1 is not null and for Null that row should not be update…
Any Ideas ….
Thanks For The Helps
Add a handler to the
RowUpdatingevent of your adapter:In the handler, check
myField1and set theStatusProperty of the argumente(of type RowUpdatingEventArgs) to UpdateStatus.SkipCurrentRow (or any other value you see more suitable likeErrorsOccurred…):