Solved

deleting empty rows from the data table...

Posted on 2006-07-06
1
1,524 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 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