S
Shayer
Hello All,
I write the following code to access Data from a table
But i get the exception "Syntax Error in From Clause"
when i write the code in SQL then it works perfectly.
OleDbConnection Myconnection = null;
OleDbDataReader dbReader = null;
Myconnection = new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0; User
Id=; Password=; Data Source=C:\STTS.mdb");
Myconnection.Open();
OleDbCommand cmd = Myconnection.CreateCommand();
cmd.CommandText = "SELECT * FROM user";
dbReader = cmd.ExecuteReader();
string Email;
while(dbReader.Read())
{
Email = (string)dbReader.GetValue(0);
lb.Items.Add(Email);
}
dbReader.Close();
Myconnection.Close();
Can anybody tell me where is the error
Thanks
I write the following code to access Data from a table
But i get the exception "Syntax Error in From Clause"
when i write the code in SQL then it works perfectly.
OleDbConnection Myconnection = null;
OleDbDataReader dbReader = null;
Myconnection = new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0; User
Id=; Password=; Data Source=C:\STTS.mdb");
Myconnection.Open();
OleDbCommand cmd = Myconnection.CreateCommand();
cmd.CommandText = "SELECT * FROM user";
dbReader = cmd.ExecuteReader();
string Email;
while(dbReader.Read())
{
Email = (string)dbReader.GetValue(0);
lb.Items.Add(Email);
}
dbReader.Close();
Myconnection.Close();
Can anybody tell me where is the error
Thanks