示例#1
0
        private async Task <List <string> > GetAllTablesAsync()
        {
            string        sqlText          = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG = 'chat-hub-db'";
            List <string> listOfTableNames = await SQLQueryExecutor.ExecuteQuery(sqlText, Configuration);

            return(listOfTableNames);
        }
示例#2
0
        public async Task <bool> IsUserTableInDatabase(string userPhoneNum)
        {
            string sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES "
                         + "WHERE TABLE_NAME ='" + userPhoneNum + "';";
            List <string> tableNames = await SQLQueryExecutor.ExecuteQuery(sql, Configuration);

            if (tableNames.Count > 0)
            {
                System.Diagnostics.Debug.WriteLine("tableNames count > 0");
                return(true);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("tableNames count = 0");
                return(false);
            }
        }