J
Jason Shohet
I have the below code, that executes a Oracle proc returning a ref-cursor.
It works FINE when I run the proc by itself in Oracle But when I call
it from my code-behind page, I get this crazy .NET error,
"No error information available: REGDB_E_CLASSNOTREG(0x80040154)"
Hehe. Nice helpful message there Microsoft. Anyhow my code is below. The
1st parameter when I create the OleDbCommand, and also the 1st param when I
create the sda, is the 'selectcommandtext' argument. I know usually you
put the select statement in there. Since I'm calling a proc, do i leave
that as "" for both? Or do I need to put something else in the 1st param,
say, when I create the SDA? Also, I got that connection string stuff off
the web somewhere & just put my own userid / datasource / password in there.
The other stuff, I'm not sure what it is or if its right Thanks for any
help!!
DataSet ds = new DataSet();
OleDbConnection con = new OleDbConnection();
con.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security
Info=False; User ID=wc; Password=wcabc; Data
Source=WPRP;PLSQLRSet=1;Extended Properties=\"\"";
OleDbCommand cmd = new OleDbCommand("", con);
cmd.CommandType = CommandType.StoredProcedure ;
cmd.CommandText = "pkg_get_bldgs.PCOC_PREMISYS_BLDG_CNTCT";
cmd.Parameters.Add("@AN_BLDG_ID","693"); // PASSING IN A VALUE AS A PARAM
OleDbDataAdapter sda = new OleDbDataAdapter("", con);
sda.SelectCommand = cmd;
sda.Fill(ds, "ADDRESS"); // IT BLOWS UP HERE
dg1.DataSource = ds.Tables[1];
It works FINE when I run the proc by itself in Oracle But when I call
it from my code-behind page, I get this crazy .NET error,
"No error information available: REGDB_E_CLASSNOTREG(0x80040154)"
Hehe. Nice helpful message there Microsoft. Anyhow my code is below. The
1st parameter when I create the OleDbCommand, and also the 1st param when I
create the sda, is the 'selectcommandtext' argument. I know usually you
put the select statement in there. Since I'm calling a proc, do i leave
that as "" for both? Or do I need to put something else in the 1st param,
say, when I create the SDA? Also, I got that connection string stuff off
the web somewhere & just put my own userid / datasource / password in there.
The other stuff, I'm not sure what it is or if its right Thanks for any
help!!
DataSet ds = new DataSet();
OleDbConnection con = new OleDbConnection();
con.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security
Info=False; User ID=wc; Password=wcabc; Data
Source=WPRP;PLSQLRSet=1;Extended Properties=\"\"";
OleDbCommand cmd = new OleDbCommand("", con);
cmd.CommandType = CommandType.StoredProcedure ;
cmd.CommandText = "pkg_get_bldgs.PCOC_PREMISYS_BLDG_CNTCT";
cmd.Parameters.Add("@AN_BLDG_ID","693"); // PASSING IN A VALUE AS A PARAM
OleDbDataAdapter sda = new OleDbDataAdapter("", con);
sda.SelectCommand = cmd;
sda.Fill(ds, "ADDRESS"); // IT BLOWS UP HERE
dg1.DataSource = ds.Tables[1];