AsyncDataAdapter.Tests/TestUtility/TestTable.cs
/// <summary>Creates a DataTable with the same structure as this table, but without any rows. This table can be used by <see cref="System.Data.DataTableReader"/> for use with <see cref="System.Data.Common.DbDataReader.GetSchemaTable"/>.</summary>
Creates a DataTable with the same structure as this table, but without any rows. This table can be used by  for use with .
Creates a DataTable with the same structure as this table but without any rows . This table can be used by for use with .
public DataTable CreateMinimalSchemaTable()
        {
            DataTable dt = new DataTable( tableName: this.Name );
            for( Int32 x = 0; x < this.ColumnNames.Length; x++ )
            {
                DataColumn col = new DataColumn( columnName: this.ColumnNames[x], dataType: this.ColumnTypes[x] );
                if( x == 0 )
                {
                    col.Unique      = true;
                    col.AllowDBNull = false;
                }
                dt.Columns.Add( col );
            }
            dt.PrimaryKey = new DataColumn[] { dt.Columns[0] };
            return dt;
        }
public DataTable CreateMinimalSchemaTable ( ) { DataTable dt = new DataTable ( tableName : this . Name ) ; for ( Int32 x = 0 ; x < this . ColumnNames . Length ; x ++ ) { DataColumn col = new DataColumn ( columnName : this . ColumnNames [ x ] , dataType : this . ColumnTypes [ x ] ) ; if ( x == 0 ) { col . Unique = true ; col . AllowDBNull = false ; } dt . Columns . Add ( col ) ; } dt . PrimaryKey = new DataColumn [ ] { dt . Columns [ 0 ] } ; return dt ; }
Creates a DataTable with the same structure as this table, but without any rows.
Creates a DataTable with the same structure as this table but without any rows .