I have a VB.NET application that is getting data from various sources and saving this to an access database for subsequent reporting.
I am inserting approx 18000 records via a dataset and when I call the update command this is taking over 5 minutes to run
Is this normal or am I missing something?
After opening my database connection I initialise my adapter etc. as follows: -
DA_MyData = New OleDbDataAdapter
DA_MyData.SelectCommand = New OleDbCommand("SELECT * FROM [MyTable]", con)
CB_MyData = New OleDbCommandBuilder(DA_MyData)
DA_MyData.Fill(DS_MyData, "MyTable")
DT_MyData = DS_MyData.Tables("MyTable")
Then the processing that loops through the various other data sources populates this dataset as follows:-
...start of loop...
DR_MyData = DT_MyData.NewRow
DR_MyData("Field1") = strField1
DR_MyData("Field2") = strField2
DR_MyData("Field3") = strField3
DR_MyData("Field4") = strField4
DT_MyData.Rows.Add(DR_MyData)
...end of loop...
Finally before closing the database and tidying up i run the update on the dataset as follows:-
DA_MyData.Update(DS_MyData, "MyTable")
It is this last bit that takes a long time to run!
I am inserting approx 18000 records via a dataset and when I call the update command this is taking over 5 minutes to run
Is this normal or am I missing something?
After opening my database connection I initialise my adapter etc. as follows: -
DA_MyData = New OleDbDataAdapter
DA_MyData.SelectCommand = New OleDbCommand("SELECT * FROM [MyTable]", con)
CB_MyData = New OleDbCommandBuilder(DA_MyData)
DA_MyData.Fill(DS_MyData, "MyTable")
DT_MyData = DS_MyData.Tables("MyTable")
Then the processing that loops through the various other data sources populates this dataset as follows:-
...start of loop...
DR_MyData = DT_MyData.NewRow
DR_MyData("Field1") = strField1
DR_MyData("Field2") = strField2
DR_MyData("Field3") = strField3
DR_MyData("Field4") = strField4
DT_MyData.Rows.Add(DR_MyData)
...end of loop...
Finally before closing the database and tidying up i run the update on the dataset as follows:-
DA_MyData.Update(DS_MyData, "MyTable")
It is this last bit that takes a long time to run!