protected Boolean loginMember()
{
SqlConnection conLogin = new SqlConnection(ConfigurationManager.ConnectionStrings["connMSJ"].ConnectionString);
SqlCommand cmdLogin;
conLogin.Open();
cmdLogin = new SqlCommand("SELECT Username, Password FROM Member WHERE (UserName=@ID AND Password=@Pass)", conLogin);
cmdLogin.Parameters.AddWithValue("@ID", txtID.Text);
cmdLogin.Parameters.AddWithValue("@Pass", txtPassword.Text);
SqlDataReader myReader = cmdLogin.ExecuteReader();
if (myReader.Read())
return true;
else
return false;
}
When i execute the login button will fire this event,
if return true to response.redirect("page2.aspx") otherwise will display a message box.
But after execute the login button, it show me this error and hightlightedconLogin.Open();