Create a stored procedure that accepts the name as input ....From that name return the password of current name...Check if both the value in text box and the result from the procedure is same or not...
string Password="";
SqlDataReader ObjReader=null;
SqlCommand cmd = new SqlCommand("spLogin", open());
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@LoginName", TextBoxUserName.ToString());
ObjReader=cmd.ExecuteReader();
while(ObjReader.read())
{
Password=ObjReader[0].toString();
}
if(Password==TextBoxPassword.toString())
{
}
else
{
UserName are password wrong;
}