Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Returning UDT (Oracle Object) from a procedure to C#

user8600823Sep 28 2009 — edited Aug 9 2010
Hi,

I have defined an object in the database and am returning that in a pl/sql procedure back to my webapp written C# using odp.net (11.1.0.7). I have created a custom class for the object so I can pass the object in my C# code. The call to pl/sql works fine and it returns the object. However I do not know how to assign that to my C# object so that my C# object gets populated.

Here is what I am trying to do.

OracleConnection conn = new OracleConnection();
conn.ConnectionString = "Data Source=(tns_entry);User ID=APP;Password=pwd";


using (OracleCommand cmd = new OracleCommand("package.proc_name", conn)) {

cmd.Parameters.Add("p_test_obj", OracleDbType.Object).Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();

TEST_OBJ test = cmd.Parameters["p_test_obj"]; ?????????????? (need to populate the object that is returned in the pl/sql call
}


Can someone tell me how to do this.


Thanks for the help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2010
Added on Sep 28 2009
2 comments
5,803 views