ERROR: Syntax error in query. Incomplete query clause. Please help me.
string db_file = null;
OpenFileDialog op = new OpenFileDialog();
op.InitialDirectory = Application.StartupPath + "\\out";
op.Filter = "DBF file|*.dbf";
if (op.ShowDialog() == DialogResult.OK)
{
db_file = op.FileName;
FileInfo fi = new FileInfo(op.FileName);
String ConnectionString;
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fi.DirectoryName + ";Extended Properties=dBase 5.0;Mode=Read|Write|Share Deny None;Persist Security Info=True";
System.Data.OleDb.OleDbConnection dBaseConnection;
dBaseConnection = new System.Data.OleDb.OleDbConnection(ConnectionString);
dBaseConnection.Open();
System.Data.OleDb.OleDbCommand dBaseCommand;
dBaseCommand = new System.Data.OleDb.OleDbCommand("Select * From '" + Path.GetFileNameWithoutExtension(fi.Name) + "'", dBaseConnection);
System.Data.OleDb.OleDbDataReader dBaseDataReader;
dBaseDataReader = dBaseCommand.ExecuteReader();
while (dBaseDataReader.Read())
{
MessageBox.Show("x");
}
dBaseDataReader.Close();
ERROR: Syntax error in query. Incomplete query clause.