System.Data.Common.DataAdapter.FillSchemaFromReader(System.Data.DataSet, System.Data.DataTable, System.Data.SchemaType, string, System.Data.IDataReader)

Here are the examples of the csharp api class System.Data.Common.DataAdapter.FillSchemaFromReader(System.Data.DataSet, System.Data.DataTable, System.Data.SchemaType, string, System.Data.IDataReader) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: referencesource
Source File: DataAdapter.cs
View license
virtual protected DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType, string srcTable, IDataReader dataReader) { // V1.2.3300
            IntPtr hscp;
            Bid.ScopeEnter(out hscp, "<comm.DataAdapter.FillSchema|API> %d#, dataSet, schemaType=%d{ds.SchemaType}, srcTable, dataReader\n", ObjectID, (int)schemaType);
            try {
                if (null == dataSet) {
                    throw ADP.ArgumentNull("dataSet");
                }
                if ((SchemaType.Source != schemaType) && (SchemaType.Mapped != schemaType)) {
                    throw ADP.InvalidSchemaType(schemaType);
                }
                if (ADP.IsEmpty(srcTable)) {
                    throw ADP.FillSchemaRequiresSourceTableName("srcTable");
                }
                if ((null == dataReader) || dataReader.IsClosed) {
                    throw ADP.FillRequires("dataReader");
                }
                // user must Close/Dispose of the dataReader
                object value = FillSchemaFromReader(dataSet, null, schemaType, srcTable, dataReader);
                return (DataTable[]) value;
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }

2. Example

Project: referencesource
Source File: DataAdapter.cs
View license
virtual protected DataTable FillSchema(DataTable dataTable, SchemaType schemaType, IDataReader dataReader) { // V1.2.3300
            IntPtr hscp;
            Bid.ScopeEnter(out hscp, "<comm.DataAdapter.FillSchema|API> %d#, dataTable, schemaType, dataReader\n", ObjectID);
            try {
                if (null == dataTable) {
                    throw ADP.ArgumentNull("dataTable");
                }
                if ((SchemaType.Source != schemaType) && (SchemaType.Mapped != schemaType)) {
                    throw ADP.InvalidSchemaType(schemaType);
                }
                if ((null == dataReader) || dataReader.IsClosed) {
                    throw ADP.FillRequires("dataReader");
                }
                // user must Close/Dispose of the dataReader
                // user will have to call NextResult to access remaining results
                object value = FillSchemaFromReader(null, dataTable, schemaType, null, dataReader);
                return (DataTable) value;
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }