Page 1 of 1

Package Wizard Question

Posted: Thu 12 Oct 2006 17:24
by pbright
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

Posted: Thu 12 Oct 2006 17:42
by pbright
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();
}

Posted: Fri 13 Oct 2006 12:15
by Alexey
Yes. You are correct.