コード例 #1
0
        internal static DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes)
        {
            DataColumn?sortindex = dataTable.Columns[SchemaMappingUnsortedIndex];

            if (null == sortindex)
            {
                sortindex = new DataColumn(SchemaMappingUnsortedIndex, typeof(int));
                dataTable.Columns.Add(sortindex);
            }
            int count = dataTable.Rows.Count;

            for (int i = 0; i < count; ++i)
            {
                dataTable.Rows[i][sortindex] = i;
            }
            ;
            DbSchemaTable schemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes);


            DataRow[] dataRows = SelectRows(dataTable, returnProviderSpecificTypes);
            Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows");

            DbSchemaRow[] schemaRows = new DbSchemaRow[dataRows.Length];

            for (int i = 0; i < dataRows.Length; ++i)
            {
                schemaRows[i] = new DbSchemaRow(schemaTable, dataRows[i]);
            }
            return(schemaRows);
        }
コード例 #2
0
ファイル: DBSchemaRow.cs プロジェクト: dox0/DotNet471RS3
        static internal DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes)   // MDAC 60609
        {
            DataColumn sortindex = dataTable.Columns[SchemaMappingUnsortedIndex];

            if (null == sortindex)                                                     // WebData 100390
            {
                sortindex = new DataColumn(SchemaMappingUnsortedIndex, typeof(Int32)); // MDAC 67050
                dataTable.Columns.Add(sortindex);
            }
            int count = dataTable.Rows.Count;

            for (int i = 0; i < count; ++i)
            {
                dataTable.Rows[i][sortindex] = i;
            }
            ;
            DbSchemaTable schemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes);

            const DataViewRowState rowStates = DataViewRowState.Unchanged | DataViewRowState.Added | DataViewRowState.ModifiedCurrent;

            DataRow[] dataRows = dataTable.Select(null, "ColumnOrdinal ASC", rowStates);
            Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows");

            DbSchemaRow[] schemaRows = new DbSchemaRow[dataRows.Length];

            for (int i = 0; i < dataRows.Length; ++i)
            {
                schemaRows[i] = new DbSchemaRow(schemaTable, dataRows[i]);
            }
            return(schemaRows);
        }
コード例 #3
0
ファイル: DBSchemaRow.cs プロジェクト: dotnet/corefx
        internal static DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes)
        {
            DataColumn sortindex = dataTable.Columns[SchemaMappingUnsortedIndex];
            if (null == sortindex)
            {
                sortindex = new DataColumn(SchemaMappingUnsortedIndex, typeof(int));
                dataTable.Columns.Add(sortindex);
            }
            int count = dataTable.Rows.Count;
            for (int i = 0; i < count; ++i)
            {
                dataTable.Rows[i][sortindex] = i;
            };
            DbSchemaTable schemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes);

            const DataViewRowState rowStates = DataViewRowState.Unchanged | DataViewRowState.Added | DataViewRowState.ModifiedCurrent;
            DataRow[] dataRows = dataTable.Select(null, "ColumnOrdinal ASC", rowStates);
            Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows");

            DbSchemaRow[] schemaRows = new DbSchemaRow[dataRows.Length];

            for (int i = 0; i < dataRows.Length; ++i)
            {
                schemaRows[i] = new DbSchemaRow(schemaTable, dataRows[i]);
            }
            return schemaRows;
        }
コード例 #4
0
        internal static DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes)
        {
            DataColumn column = dataTable.Columns["SchemaMapping Unsorted Index"];

            if (column == null)
            {
                column = new DataColumn("SchemaMapping Unsorted Index", typeof(int));
                dataTable.Columns.Add(column);
            }
            int count = dataTable.Rows.Count;

            for (int i = 0; i < count; i++)
            {
                dataTable.Rows[i][column] = i;
            }
            DbSchemaTable schemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes);

            System.Data.DataRow[] rowArray  = dataTable.Select(null, "ColumnOrdinal ASC", DataViewRowState.CurrentRows);
            DbSchemaRow[]         rowArray2 = new DbSchemaRow[rowArray.Length];
            for (int j = 0; j < rowArray.Length; j++)
            {
                rowArray2[j] = new DbSchemaRow(schemaTable, rowArray[j]);
            }
            return(rowArray2);
        }
コード例 #5
0
 internal static DbSchemaRow[] GetSortedSchemaRows(DataTable dataTable, bool returnProviderSpecificTypes)
 {
     DataColumn column = dataTable.Columns["SchemaMapping Unsorted Index"];
     if (column == null)
     {
         column = new DataColumn("SchemaMapping Unsorted Index", typeof(int));
         dataTable.Columns.Add(column);
     }
     int count = dataTable.Rows.Count;
     for (int i = 0; i < count; i++)
     {
         dataTable.Rows[i][column] = i;
     }
     DbSchemaTable schemaTable = new DbSchemaTable(dataTable, returnProviderSpecificTypes);
     System.Data.DataRow[] rowArray = dataTable.Select(null, "ColumnOrdinal ASC", DataViewRowState.CurrentRows);
     DbSchemaRow[] rowArray2 = new DbSchemaRow[rowArray.Length];
     for (int j = 0; j < rowArray.Length; j++)
     {
         rowArray2[j] = new DbSchemaRow(schemaTable, rowArray[j]);
     }
     return rowArray2;
 }
コード例 #6
0
 internal DbSchemaRow(DbSchemaTable schemaTable, DataRow dataRow)
 {
     _schemaTable = schemaTable;
     _dataRow     = dataRow;
 }
コード例 #7
0
 internal DbSchemaRow(DbSchemaTable schemaTable, System.Data.DataRow dataRow)
 {
     this.schemaTable = schemaTable;
     this.dataRow = dataRow;
 }
コード例 #8
0
ファイル: DBSchemaRow.cs プロジェクト: dox0/DotNet471RS3
 internal DbSchemaRow(DbSchemaTable schemaTable, DataRow dataRow)
 {
     this.schemaTable = schemaTable;
     this.dataRow     = dataRow;
 }
コード例 #9
0
ファイル: DBSchemaRow.cs プロジェクト: dotnet/corefx
 internal DbSchemaRow(DbSchemaTable schemaTable, DataRow dataRow)
 {
     _schemaTable = schemaTable;
     _dataRow = dataRow;
 }