Solved

Running PL/SQL Stored Procedure from C# using ADO.net (PL/SQL Table Datatype)

Posted on 2003-10-27
2
1,830 Views
Last Modified: 2007-12-19
Hi,

I am trying to run a third party PL/SQL stored procedure held on an Oracle database, using an ADO.net command in a C# application. However, I cannot match a PL/SQL Table datatype parameter in the stored procedure with any ADO.NET datatype.

Using OO4O in VBA I am able to create a table-parameter using OraDatabase.Parameters.AddTable. Is there any way of doing this in ADO.NET?

Thanks in advance...

 
0
Comment
Question by:tgannetts
2 Comments
 

Accepted Solution

by:
chrisalexander earned 100 total points
ID: 9639724
Oh the pain... I just finished dealing with the issue of using OraTypes in C# and it hurt. Firstly, I believe that Oracle's native .NET provider called Oracle Data Provider (ODP.NET) supports PL/SQL table collections. Go to Oracle.com to download ODP.NET on your dev workstation. Secondly, if this doesn't work then things are going to get alittle messy because you will have to unbox OraTypes to OO4O types. I would recommend using VB.NET and OO4O to create a unit test case of manipulating the PL/SQL table collection. F10 through this block of code to observe the OO4O datatype of each variable. In C# you will have to declare variables of these datatypes (ie OraCollection ObjCol;). Because the RunTime is serverely type safe you will need to unbox the PL/SQL table collection item OraTypes to the OO4O datatypes.

Although Oracle bitches about not supporting OO4O with .NET and the cominterop penalty I have been able to get a web-based app working just fine using Object data types. Just be careful if you use OO4O connection pooling as it does NOT remove connections when shutting down the application; connections become inactive and require some Oracle admin sniping/killing skill.

P.S. log onto MetaLink and explore. Again, the techs are pretty bitchy about answering OO4O/C# related questions though.

Hope this helps,

Chris
0
 
LVL 5

Author Comment

by:tgannetts
ID: 9656426
Thanks Chris,

I had a look at ODP, but we have Oracle 8i - Oracle 9i required.

As you suggested, I tried using OO4O in vb.net. The code I had already written in vba transferred nicely with little re-working required. (in fact with dbnull.value support it worked a lot better).

As far as C# is concerned, as a quick work around I have put all my vba code into a vb.net class library, and am referencing this from my C# application.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question