public static int LaySoDong(string sql) { ConnectionDB connectionDB = new ConnectionDB(); connectionDB.OpenConnection(); int row = connectionDB.ExecuteScalar(CommandType.Text, sql); connectionDB.CloseConnection(); return(row); }
public int DaTonTai(string TenDangNhap) { string sql = string.Format("select count(*) from NGUOIDUNG where TenDangNhap = '{0}'", TenDangNhap); ConnectionDB connectionDB = new ConnectionDB(); connectionDB.OpenConnection(); int kq = connectionDB.ExecuteScalar(CommandType.Text, sql); connectionDB.CloseConnection(); return(kq); }