System.Data.Common.DbDataAdapter.GetConnection3(System.Data.Common.DbDataAdapter, System.Data.IDbCommand, string)

Here are the examples of the csharp api class System.Data.Common.DbDataAdapter.GetConnection3(System.Data.Common.DbDataAdapter, System.Data.IDbCommand, string) 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: DbDataAdapter.cs
View license
private object FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, string srcTable, CommandBehavior behavior) {
            object dataTables = null;
            bool restoreNullConnection = (null == command.Connection);
            try {
                IDbConnection activeConnection = DbDataAdapter.GetConnection3(this, command, ADP.FillSchema);
                ConnectionState originalState = ConnectionState.Open;

                try {
                    QuietOpen(activeConnection, out originalState);
                    using(IDataReader dataReader = command.ExecuteReader(behavior | CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo)) {
                        if (null != datatable) { // delegate to next set of protected FillSchema methods
                            dataTables = FillSchema(datatable, schemaType, dataReader);
                        }
                        else {
                            dataTables = FillSchema(dataset, schemaType, srcTable, dataReader);
                        }
                    }
                }
                finally {
                    QuietClose(activeConnection, originalState);
                }
            }
            finally {
                if (restoreNullConnection) {
                    command.Transaction = null;
                    command.Connection = null;
                }
            }
            return dataTables;
        }

2. Example

Project: referencesource
Source File: DbDataAdapter.cs
View license
private int FillInternal(DataSet dataset, DataTable[] datatables, int startRecord, int maxRecords, s/n ..... /n //View Source file for more details /n }