Solved

deleting empty rows from the data table...

Posted on 2006-07-06
1
1,521 Views
Last Modified: 2012-06-27
Hi,
 I have a data table which has some Empty rows in it... I just wanna delete those empty rows...
(Filled the data table from Excel sheet, which has some empty rows in it...)

Problem sounds simple, but was not able to figure out... :(

Thank You,
Steve
0
Comment
Question by:steve_mick972
1 Comment
 
LVL 14

Accepted Solution

by:
Ramuncikas earned 500 total points
ID: 17053092
That depends on what a term "empty" covers. If "empty" means that field "Name" has an empty string as a value then you can do it like this:

Dim i as long
i = 0
While i <= myTable.Rows.Count -1
   if myTable.Rows(i)("Name") = String.Empty Then
      myTable.Rows.RemoveAt(i)
   Else
      i += 1
   End if
End while
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Output Caching in IIS 2 35
Open MVC5 View in new Window (not Tab) using HTML.ActionLink 6 47
No Data for DropDown List 2 28
Add a Condition in ASP Repeater 6 33
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question