Click here to Skip to main content
15,923,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,

I am one project which have a facility to import CSV file and save in Access Database.
Below are the step which I set up in a code .
1) Made one function which parsed the CSV file and return the datatable.
2) Assigned that datatable to a gridview.

Now the issue is , If that CSV file contain blank line then grid view shows new rows with empty value . It create issues while inserting data into database.

I did validation on saving side but it not proper to show empty value on grid.
One thing both are above step are one shot operation so no control on that.

Is there any way to run SQL command on datatable for deleting the empty row ?.
Posted

1 solution

One way is that you:
- create an empty clone from the datatable using Clone[^]
- select non-empty rows using Select[^]
- add the rows from the select to the new table using Rows.Add[^]
 
Share this answer
 
Comments
RDBurmon 18-Apr-11 4:56am    
Thanks Mika.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900