You need to modify your command. Try this:
const string query1 = ("Select * from emp_tracker_username where username=@username and password=@password");
OleDbCommand cmd1 = new OleDbCommand(query1, cn1);
cmd1.Parameters.AddWithValue("@username", txtusername.Text);
cmd1.Parameters.AddWithValue("@password", txtpassword.Text);
OleDbDataAdapter ad1 = new OleDbDataAdapter(cmd1);
DataSet dt1 = new DataSet();
ad1.Fill(dt1);
if (dt1.Tables[0].Rows.Count > 0)
{
if(Convert.ToBoolean(dt1.Tables[0].Rows[0]["Active"])){
Form f4 = new frmCorporateNewid();
f4.Show();
this.Hide();
}
else{
MessageBox.Show("User is inactive. Contact your admin");
}
}
else
{
MessageBox.Show("Login Unsucessful...!");
}
--Amit