Solved

deleting empty rows from the data table...

Posted on 2006-07-06
1
1,522 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generate Unique ID in VB.NET 21 103
Data organization issue 7 37
disadvantage of code behind appoarch in asp.net 3 28
asp.net web app 3 20
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

756 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