public Table MakeTable(Database database, UtlDataReader reader) { QNameManager.QName name = database.NameManager.NewQName("PARAMETER___TABLE", false, 3); Table table = new Table(database, name, 11); for (int i = 0; i < reader.FieldCount; i++) { QNameManager.QName name1 = database.NameManager.NewQName(reader.GetName(i).ToUpper(), false, 9); name1.schema = SqlInvariants.ModuleQname; name1.Parent = name; DataTable schemaTable = reader.GetSchemaTable(); ColumnSchema column = new ColumnSchema(name1, Types.GetParameterSqlType((Type)schemaTable.Rows[i][SchemaTableColumn.DataType]), (bool)schemaTable.Rows[i][SchemaTableColumn.AllowDBNull], false, null); table.AddColumn(column); } table.CreatePrimaryKey(); return(table); }
public bool IsCompatible(UtlDataReader reader) { if (reader.FieldCount != this._dataTypes.Length) { return(false); } for (int i = 0; i < reader.FieldCount; i++) { ColumnSchema column = this._table.GetColumn(i); if ((reader.GetDataTypeName(i).ToUpper() != column.DataType.GetNameString()) || (reader.GetName(i).ToUpper() != column.ColumnName.Name)) { return(false); } } return(true); }