|
-
Sep 5th, 2012, 05:53 PM
#1
Thread Starter
Addicted Member
Filling DataGridView
I'd like to delete and add data to a access database using DataGridView1. I know there's a more elegant solution using OleDb.OleDbConnection but I want to do something a little simplier.
So this is what I did so far. I added a DataGridView1 linking to an access database.
i=0
Do while ... end of text file
Read first line from text file
DataGridView1.Item(1, i).Value = line_by_line
i = i+1
Loop
The problem is if the data from the text file is longer that the number of rows in the datagridview I get an error. If the text file is shorter, the remaining existing data in the datagridview is not cleaned out. Any suggestions?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|