Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-10-27
2
Medium Priority
?
1,836 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
chrisalexander earned 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

670 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