private static IDbConnection GetConnection1(DbDataAdapter adapter)
{
IDbCommand command = adapter._IDbDataAdapter.SelectCommand;
if (null == command)
{
command = adapter._IDbDataAdapter.InsertCommand;
if (null == command)
{
command = adapter._IDbDataAdapter.UpdateCommand;
if (null == command)
{
command = adapter._IDbDataAdapter.DeleteCommand;
}
}
}
IDbConnection connection = null;
if (null != command)
{
connection = command.Connection;
}
if (null == connection)
{
throw ADP.UpdateConnectionRequired(StatementType.Batch, false);
}
return connection;
}