Problem filling Strongly Typed DataSet from an Oracle 9i stored procedure that returns multiple ref

D

DotNetGruven

Hi,
I'm returning 12 tables worth of data from one Oracle stored procedure
using the technique documented in:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;321715

The problem I'm having is getting the .Fill() to do the right thing.
Depending on which overload of Fill() I use, I get either 24 tables when I
use .Fill(dataSet) (the original 12 tables don't get filled, 12 new tables
get created) or I get 145 Tables in the DataSet when I call
..Fill(using_the_dataTable_object_in_the_dataset) 12 times, once for each of
the 12 datatables.

So, the question is, how do I get the 12 ref cursors to fill the 12
tables in the DataSet?

It seems like Fill() tries to match up the name of the RefCursor with
the name of the Table. Unfortuntunately, I had to make the name of the
RefCursors the name of the original table suffixed with '_O'. So, I tried
changing the name of the tables by setting the TableName property to match
that of the RefCursor. Still no joy! :(

Any help will be greatly appreciated,
geo
 
D

DotNetGruven

What is the name of the principle that says you will figure out the problem
you have been working on for hours 10 minutes after you post to the world
that you need help? :)

It turns out mapping the table names did it.

oracleDataAdapter.TableMappings.Add("Table", "Departments");

oracleDataAdapter.TableMappings.Add("Table1", "ProductCategories");

oracleDataAdapter.TableMappings.Add("Table2", "Products");

.....



Any other ways to do the same thing?

-g
 
K

Kevin Yu [MSFT]

Hi DotNetGruven,

I was nice hear that you have got a solution to the problem.

As far as I know, it is the most reliable way to achieve this. We can
either set table mappings in code or in the Table Mappings Dialog Box. Here
are some useful links for you. HTH.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatacommondataadapterclasstablemappingstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
ml/vburfMappingsDialogBox.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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