public static bool CheckUser(string userName, string password) { using (ConnectDB connectDB = new ConnectDB()) { connectDB.Conection(); try { string query = "SELECT Count(*) FROM dbo.tblUser WHERE Username = @UserName AND Password = @Password"; return(connectDB.GetDataUserfromDB(query, userName, password)); } catch (Exception ex) { throw; } } }