Package Wizard Question

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
pbright
Posts: 3
Joined: Tue 27 Sep 2005 18:48
Contact:

Package Wizard Question

Post by pbright » Thu 12 Oct 2006 17:24

Ok new to Asp.net and have tried to use the new Oracle Package Wizard to generate the c# code to the Oracle package trying to interface.

I create a ref to the Auto created class as follows:

HrdsnPkg classref = new HrdsnPkg();

How do a setup a connection using this auto generated package

Calling something like:

classref.Connection.ConnectionString = "someserver.com etc....";

causes a null ref error...

I want to call this after the connection part is figured out would this call be correct:

OracleCursor pCursor;
Decimal pErrorlogid;
classref.GetPicklistcompany( out pCursor, out pErrorlogid);

Thanks

pbright
Posts: 3
Joined: Tue 27 Sep 2005 18:48
Contact:

Post by pbright » Thu 12 Oct 2006 17:42

Thanks for the help .. but I figured it out ... Best Regards.

Here was the solution:

HrdsnPkg classref = new HrdsnPkg();
classref.Connection = new OracleConnection( "some connection string" );
classref.Connection.Open();
try
{

OracleCursor pCursor;
Decimal pErrorlogid;
classref.GetPicklistcompany( out pCursor, out pErrorlogid);

CoreLab.Oracle.OracleDataAdapter test = new OracleDataAdapter( );
DataSet ds = new DataSet();

test.Fill(ds, "result", pCursor);

}
finally
{
classref.Connection.Close();
GC.Collect();
}

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 13 Oct 2006 12:15

Yes. You are correct.

Post Reply