Пример #1
0
        /// <summary>
        /// 加载数据库的表
        /// </summary>
        private List <BaseTable> LoadBaseTable()
        {
            string    BaseType = DataConnection.DBInfo.BaseName;
            DataTable dt       = new DataTable();

            if (BaseType == EDType.MySQL.ToString())
            {
                MySQLBSHelper MySQL = new MySQLBSHelper(PComm.ConnectionName);
                dt = MySQL.BsDataTable($"select table_name as TableName from information_schema.tables where table_schema = '{DataConnection.DBInfo.DataName}' order by TABLE_NAME asc ");
            }
            else if (BaseType == EDType.SQLServer.ToString())
            {
                SQLServerBSHelper SqlServer = new SQLServerBSHelper(PComm.ConnectionName);
                dt = SqlServer.BsDataTable("SELECT name as TableName FROM SysObjects Where XType = 'U' or XType='V' ORDER BY Name");
            }
            return(dt.ToModel <BaseTable>());
        }