471,348 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

row count after row delete

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

Jul 21 '05 #1
3 2002
Hplloyd,

This is strange can you show some (sample) code?

Cor
Jul 21 '05 #2


"hplloyd" wrote:
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

Jul 21 '05 #3
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.
"hplloyd" wrote:
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

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by phil | last post: by
22 posts views Thread by Joseph Shraibman | last post: by
14 posts views Thread by Ron James | last post: by
8 posts views Thread by novus | last post: by
1 post views Thread by rsbutterfly16 via AccessMonster.com | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.