예제 #1
0
        public static int LaySoDong(string sql)
        {
            ConnectionDB connectionDB = new ConnectionDB();

            connectionDB.OpenConnection();

            int row = connectionDB.ExecuteScalar(CommandType.Text, sql);

            connectionDB.CloseConnection();

            return(row);
        }
예제 #2
0
        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);
        }