Exemplo n.º 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);
        }
Exemplo n.º 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);
        }