row count after row delete

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datatable with 10 rows in it, I then delete a row using Row.Delete()

When I display the data table in a grid I see 9 rows but when I do
Rows.Count i get 10 rows?!? how do I get Rows.count do return the correct
number of rows

Thanks in advance

HLPL
 
hplloyd said:
I have a datatable with 10 rows in it, I then delete a row using Row.Delete()

When I display the data table in a grid I see 9 rows but when I do
Rows.Count i get 10 rows?!? how do I get Rows.count do return the correct
number of rows

Thanks in advance

HLPL
 
Use the accept changes methode for your dataset (but only after you update
the datasource).
Like this
MyDataAdapter.Update(MyDataTable) or of data set (MyDataSet,"MyDataTable")

For data table
MyDataTable.AcceptChanges

For data set
MyDataSet.Tables("MyDataTable").AcceptChanges

Hope this helps

Steven

this will cause your disconnected datatable (Or dataset) to reflect the
changes that were made to it.
 
Back
Top