C#+BDE+DBF problem
- by Drabuna
I have huge problem:
I have lots of .dbf files(~50000) and I need to import them into Oracle database.
I open conncection like this:
OleDbConnection oConn = new OleDbConnection();
OleDbCommand oCmd = new OleDbCommand();
oConn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory + ";Extended Properties=dBASE IV;User ID=Admin;Password=";
oCmd.Connection = oConn;
oCmd.CommandText = @"SELECT * FROM " + tablename;
try
{
oConn.Open();
resultTable.Load(oCmd.ExecuteReader());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
oConn.Close();
oCmd.Dispose();
oConn.Dispose();
I read them in loop, and then insert into oracle. Everything's fine.
BUT: There is about 1000 files, that I can't open. They raise exception "not a table". So I google, and install Borland Database Engine. Now everything wokrs fine....but no.
Now, when I'm reading files, on 1024 file exception raises: "System resource exceeded".
But I have lots of free resources.
When I remove BDE, everything's fine again, no "system resource exceeded" error, but I cant read all files.
Help please.
PS: Tried using ODBC but nothing changes.