Suggestion: OracleLoader to support IDataReader as a row source
-
Dennis Wanke
- Posts: 57
- Joined: Tue 11 Mar 2014 07:49
Suggestion: OracleLoader to support IDataReader as a row source
I suggest OracleLoader (in fact, all DbLoader descendants) should provide a method for importing data from a data Reader (in addition to LoadTable() that accepts a DataTable).
-
Pinturiccio
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Suggestion: OracleLoader to support IDataReader as a row source
We will investigate the possibility to import data from OracleDataReader with OracleLoader and post here about the results as soon as possible.
-
Dennis Wanke
- Posts: 57
- Joined: Tue 11 Mar 2014 07:49
Re: Suggestion: OracleLoader to support IDataReader as a row source
In fact we've already implemented this logic:
But maybe you can do it more optimally. You may also consider an option similar to SqlBulkCopy.EnableStreaming.
Code: Select all
loader.Open();
while (reader.Read())
{
foreach (OracleLoaderColumn column in loader.Columns)
{
var name = column.Name;
loader.SetValue(name, reader.GetValue(reader.GetOrdinal(name)));
}
loader.NextRow();
}