Package Wizard Question

Package Wizard Question

Postby 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

Postby 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();
}
pbright
 
Posts: 3
Joined: Tue 27 Sep 2005 18:48

Postby Alexey » Fri 13 Oct 2006 12:15

Yes. You are correct.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle