and why not do this...
private bool SiteLevelCustomAuthenticationMethod(string UserName, string Password)
{
bool boolReturnValue = false;
string strConnection = "Server=.;Initial Catalog=Doctors;Integrated Security=True";
SqlConnection Connection = new SqlConnection(strConnection);
String strSQL = "Select username,password From users Where UserName=@Username and Cast(Password as binary)=Cast(@Password as binary)";
SqlCommand command = new SqlCommand(strSQL, Connection);
command.Parameters.Add("@UserName", SqlDbType.VarChar).value = UserName;
command.Parameters.Add("@Password ", SqlDbType.VarChar).value = Password;
SqlDataReader Dr;
Connection.Open();
Dr = command.ExecuteReader();
if (Dr.HasRows()){
boolReturnValue = true;
}
Dr.Close();
Dr.Dispose();
return boolReturnValue
}
Jared Roberts
Lead Application Developer