internal DbSchemaRow(DbSchemaTable schemaTable, DataRow dataRow) { this.schemaTable = schemaTable; this.dataRow = dataRow; }
internal static DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes) { DataColumn dataColumn = dataTable.Columns["SchemaMapping Unsorted Index"]; if (dataColumn == null) { dataColumn = new DataColumn("SchemaMapping Unsorted Index", typeof(int)); dataTable.Columns.Add(dataColumn); } int count = dataTable.Rows.Count; for (int i = 0; i < count; i++) { dataTable.Rows[i][dataColumn] = i; } DbSchemaTable dbSchemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes); DataRow[] array = dataTable.Select(null, "ColumnOrdinal ASC", DataViewRowState.CurrentRows); DbSchemaRow[] array2 = new DbSchemaRow[array.Length]; for (int j = 0; j < array.Length; j++) { array2[j] = new DbSchemaRow(dbSchemaTable, array[j]); } return array2; }