Reputation: 87
I am reading some Data from a Paradox table with Oledb. The Problem I have is the code works when I copy it to a console Application but not in WinForms. Both debug as x86 and I literally just copy the code. In the WinForms App i get the External table is not in the expected format Exception.
My code:
StringBuilder ConnectionString = new StringBuilder();
OleDbConnection connection = new OleDbConnection();
ConnectionString.Append("Provider=Microsoft.Jet.OLEDB.4.0;");
ConnectionString.Append("Data Source=C:\test;");
ConnectionString.Append("Extended Properties='Paradox 5.x'");
connection.ConnectionString = ConnectionString.ToString();
OleDbCommand command = new OleDbCommand();
string query = "SELECT * FROM NACHKALK WHERE Auftrag='U04-0001'";
command.CommandText = query;
command.Connection = connection;
connection.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(command);
adp.Fill(dset);
connection.Close();
Does anybody know how I can solve this?
Upvotes: 2
Views: 1039