static void HasRows(SqlConnection connection)
{
using (connection)
{
SqlCommand command = new SqlCommand(
String.Format("Select * from user_table where username ={0} and password={};",UserName.Text, Passsword.Text),
connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows)
{
// User found
}
else
{
Console.WriteLine("No User Found.");
}
reader.Close();
}
}