当前位置: 首页>>代码示例>>C#>>正文


C# Table.getName方法代码示例

本文整理汇总了C#中Table.getName方法的典型用法代码示例。如果您正苦于以下问题:C# Table.getName方法的具体用法?C# Table.getName怎么用?C# Table.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createSnapshot

        public DatabaseSnapshot createSnapshot(liquibase.database.Database database, string schema, java.util.Set listeners)
        {
            DatabaseSnapshot snapshot = new DatabaseSnapshot(database, schema);

            OleDbConnection conn = ((AdoConnection)database.getConnection()).GetUnderlyingConnection();

             string[] restrictions = new string[4];
             restrictions[3] = "Table";

             DataTable tables = conn.GetSchema("Tables", restrictions);

             foreach (DataRow row in tables.Rows) {
                 Table table =  new Table(row.Field<String>("TABLE_NAME"));
                 table.setSchema(row.Field<String>("TABLE_SCHEMA"));

                 snapshot.getTables().add(table);

                 DataTable tableInfo = conn.GetSchema("Columns", new string[4] { null, null, table.getName(), null });

                 foreach (DataRow colRow in tableInfo.Rows) {
                     Column column = new Column();
                     column.setName(colRow.Field<string>("COLUMN_NAME"));
                     column.setTable(table);
                     //column.setTypeName(colRow.Field<string>("DATA_TYPE"));
                     //column.setColumnSize(colRow.Field<int>("NUMERIC_SCALE"));

                     table.getColumns().add(column);
                 }
             }

            return snapshot;
        }
开发者ID:kwhitmore,项目名称:GitTesting,代码行数:32,代码来源:OleDatabaseSnapshotGenerator.cs

示例2: readConstraint

        public void readConstraint(Table tab)
        {
            current = getNextToken(current, ref token);
            string constraintName = trimQuotes(token);
            current = getNextToken(current, ref token);
            if ( token.ToUpper() == "PRIMARY") {
                current = readToken(current, ref token, "KEY");
                Constraint cons = tab.addConstraint(constraintName, "primary key");
                List<string> list = readList();
                cons.setLocalColumns(list);
                current = getNextToken(current, ref token);
            } else if (token.ToUpper() == "FOREIGN") {
                current = readToken(current, ref token, "KEY");
                Constraint cons = tab.addConstraint(constraintName, "foreign key");
                string table;
                List<string> list = readList();
                cons.setLocalColumns(list);
                current = readToken(current, ref token, "REFERENCES");
                current = getNextToken(current, ref token); // table
                table = trimQuotes(token);
                list = readList();
                current = getNextToken(current, ref token);
                cons.setRemoteColumns(tab.getName(), table, list);
                if (token.ToUpper() == "ON") {
                    current = getNextToken(current, ref token); // update
                    current = getNextToken(current, ref token); // cascade
                    current = getNextToken(current, ref token);
                }

            } else if (token.ToUpper() == "KEY") {
                Constraint cons = tab.addConstraint(constraintName, "key");
                List<string> list = readList();
                cons.setLocalColumns(list);
                current = getNextToken(current, ref token);
            } else if (token.ToUpper() == "UNIQUE") {
                Constraint cons = tab.addConstraint(constraintName, "unique");
                List<string> list = readList();
                cons.setLocalColumns(list);
                current = getNextToken(current, ref token);
            }
            if (token.ToUpper() == "USING") {
                // USING INDEX TABLESPACE INDX
                while (token[0] != ')' && token[0] != ',') {
                    current = getNextToken(current, ref token);
                }
                if (token.ToUpper() == "INDEX") {
                    current = getNextToken(current, ref token);
                }
            }
        }
开发者ID:tpokorra,项目名称:sql2diagram-csharp,代码行数:50,代码来源:ParserSQL.cs

示例3: readCheck

        public void readCheck(Table tab)
        {
            current = getNextToken(current, ref token);
            if (token == "(") {
                string check = String.Empty;
                current = getNextToken(current, ref token);
                string attr = token;
                int openBrackets = 1;
                while (openBrackets > 0 && current.Length != 0 && !hFile.EndOfStream) {
                    check += " " + token;
                    current = getNextToken(current, ref token);
                    if (token == ")") {
                        openBrackets --;
                    }
                    if (token == "(") {
                        openBrackets ++;
                    }
                }

                if (!tab.setAttributeCheck(attr, check)) {
                    Console.WriteLine("could not find attribute " + attr + " in table " + tab.getName() + " to add the check.");
                }
                current = getNextToken(current, ref token);
            }
        }
开发者ID:tpokorra,项目名称:sql2diagram-csharp,代码行数:25,代码来源:ParserSQL.cs

示例4: inTableList

 public bool inTableList(Table tab, string strTableList)
 {
     return inTableList(tab.getName(), strTableList);
 }
开发者ID:tpokorra,项目名称:sql2diagram-csharp,代码行数:4,代码来源:DataBase.cs


注:本文中的Table.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。