I need a function to transfer data from a .DBF
file to SQL Server.
Here is what I do:
- First step: I use
OleDBDataAdapter.Fill
to read from.DBF
file - Second step: insert this table into SQL Server.
The first step takes 74 seconds for 90 column X 80000 rows.
Is there any way to speed this process up?
Also, if there is any way to communicated directly from .DBF
to SQL Server, please guide me. BTW, I am using C# and SQL Server 2008.
My mistake, guys. I rarely post here. Here is my code (take over 1 minute to transfer DBF into datatable):
OleDbCommand oledbcommand = new OleDbCommand();
OleDbDataAdapter adp = new OleDbDataAdapter();
oledbcommand.Connection = oledbConnectOpen();
oledbcommand.CommandText = @"SELECT * FROM " + filename;
adp.SelectCommand = oledbcommand;
adp.Fill(dt); //this is the step that consume time
dt.TableName = filename;
return dt;