public bool ValidateDeskNumber(string number)
{
SqlConnection connection = new SqlConnection(_connectionString);
SqlCommand command = new SqlCommand("Select DeskNumber from Intern_CoyoteMoves.dbo.Desk where DeskNumber='" + number + "'");
command.Connection = connection;
command.Connection.Open();
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
if (reader["DeskNumber"].ToString() == number)
{
command.Connection.Close();
return true;
}
}
command.Connection.Close();
return false;
}