Sunday, March 14, 2010

Remove Empty Records from DataTable

The content of this post has been moved here. Please check this link to view the contents.

Sorry for the inconvenience.



Anonymous said...

Thanks, it helped me.

Abhilash said...

Good to Know that it helped you.
But, still I don't know whether any better method is available than this.

I mean, any one-line code, etc.

Imtiaz Durrani said...

Plz dont forget to call AcceptChanges() after removing row
if (isEmpty == true)
33: {
34: dt.Rows.RemoveAt(i);
35: i--;
36: }

Anonymous said...

I think that you can create a dataview from the datatable and filter the rows on the condition ' id = null and name = null' - one step no iteration

Best viewed in Internet Explorer 8.