I have a DBF file with 1400+ rows and 32 columns and I need to write this to an Access DB table. The Access table was created by modifying the original structure of the DBF table in which I removed 12 unnecessary columns.

I have been successful at loading the entire DBF table into a DataTable and now I need to Update the Access table with the necessary column data. Fortunately (I think) the necessary columns are the first 20 in the DataTable.

Is it necessary to loop through the DataTable row by row or can I write the entire table in single command with NET thru CommandBuilder.

I'm not familiar with the Update aspects and eventually I need to repeat this process about 270 times.

Need some help on this Update command, appreciate some input.

Recommended Answers

All 6 Replies

Why are you using a DataTable and not an adapter/dataset?

Do you have a requirement to use only a data table?

No requirement to use Datatable; it's just what I did in a recent project so I just used that code. I'm all ears if there is a better, safer, faster way.

Not sure I know the DBF > Adapter > DataSet method.

Please go on :)

Which connection are you using to connect to your database to retrieve the data?

ADO
OleDB...ect

OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPath & filename.ToString() & ";")

I've now used the DBF > Adapter > DataSet method to grab all the data in the DBF file and I've populated a DataGridView. Now I need to Insert all the rows into the Access db. Do I need to loop through all 1400 rows or is there a simpler, faster method to accomplish this?

Keep in mind I only need the first 20 columns of data.

Thanks, appreciate any help on this particular Insert command.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.