hi
I have problem with login form in c#
I think this problem from if statment
private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=pjt;Integrated Security=True");
con.Open();
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = "SELECT * FROM LOGIN WHERE username='" + tusername.Text +"' AND password=" + tpassword.Text +"'";
SqlDataReader dr =com.ExecuteReader();
if(Convert.ToBoolean(com.CommandText))
{
Menu oform = new Menu();
oform.Show();
}
else
{
MessageBox.Show("username or password incorrect");
}
con.Close();