G
Guest
I use ADO.NET to import records from a comma delimited text file into an Access data table. The table has 1 int field (prim key), 5 text fields and 4 date fields. The text file has 50000 records. There are no records in the table to start with
I parse the text file and for each record, I do
DataRow row = dt.NewRow()
row[field1] = ..
row[field2] = ..
et
dt.Rows.Add(row)
after I have added the 50 K rows (under 20 seconds), I do
daUserData.Update(dsUserData, "UserData")
to update the physical database. The update takes about 12 minutes. Conversely, if I import the whole file in Access, the total time is under 20 seconds. One other thing, after the import, the database has grown about 25 mb. However, most of this can be compacted.
I am hoping there is a better way to do this. Any help greatly appreciated
Regards
Bob Costello
I parse the text file and for each record, I do
DataRow row = dt.NewRow()
row[field1] = ..
row[field2] = ..
et
dt.Rows.Add(row)
after I have added the 50 K rows (under 20 seconds), I do
daUserData.Update(dsUserData, "UserData")
to update the physical database. The update takes about 12 minutes. Conversely, if I import the whole file in Access, the total time is under 20 seconds. One other thing, after the import, the database has grown about 25 mb. However, most of this can be compacted.
I am hoping there is a better way to do this. Any help greatly appreciated
Regards
Bob Costello