Oracle mutliple dataset naming

B

Bradley Plett

I am using Oracle's data provider for .NET. I have a stored procedure
that returns two REF CURSORs. I use this to fill a dataset. If I do
the fill to a new dataset, everything works fine and I end up with a
dataset with two datatables called "Table" and "Table1". If I
predefine my dataset with two datatables and call them "Table" and
"Table1", that works too. However, if I try to fill a dataset with
predefined table names that do not match, then the tables are appended
as extra tables in the dataset. Is there any way of providing a map
so that the fill can fill a dataset with names I choose that are a
little more meaningful?

I would think this would be a trivial problem, but I haven't figured
out how to rename "Table" and "Table1" to something more meaningful!

Thanks!
Brad.
 
B

Bradley Plett

In case anyone cares, just after posting this a colleague showed me
the "OracleDataAdapter.TableMappings" that does this nicely. It would
still be nice if the naming could happen more automatically, but....
:)

Brad.
 
D

David Browne

Bradley Plett said:
I am using Oracle's data provider for .NET. I have a stored procedure
that returns two REF CURSORs. I use this to fill a dataset. If I do
the fill to a new dataset, everything works fine and I end up with a
dataset with two datatables called "Table" and "Table1". If I
predefine my dataset with two datatables and call them "Table" and
"Table1", that works too. However, if I try to fill a dataset with
predefined table names that do not match, then the tables are appended
as extra tables in the dataset. Is there any way of providing a map
so that the fill can fill a dataset with names I choose that are a
little more meaningful?

I would think this would be a trivial problem, but I haven't figured
out how to rename "Table" and "Table1" to something more meaningful!

The DataAdapter has mappaping facilities, but I never use them.

I just use ExecuteNonQuery, bind out the OracleRefCursor parameters, and use
each one in a call to OracleDataAdapter.Fill(DataTable,OracleRefCursor).
That way you have 100% control of which tables get filled with which
results.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top