this is my problem, here is where i am stuck...
https://drive.google.com/file/d/0BxqCNfHpYEJlejVwcGxYVHo1VWM/view?usp=sharing
can you help he... please bear with me if this one seems so obvious...
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Sparrow vivek\Documents\Billing.accdb";
con.Open();
String query = "select * from user where username='" + textBox1.Text + "'and password='" + textBox2.Text + "'";
OleDbCommand cmd = new OleDbCommand(query, con);
//cmd.ExecuteNonQuery();
OleDbDataReader rd = cmd.ExecuteReader();
int i = 0;
String ss = null;
while (rd.Read())
{
i++;
ss = rd[0].ToString();
}
if (i > 0)
{
Form4 f4 = new Form4();
this.Hide();
f4.Show();
con.Close();
}
else
{
label4.Text = "Username or Password not valid";
label4.ForeColor = Color.Red;
}
con.Close();
user
is an sql keyword...use[user]
instead or rename your table – webber2k6