Unable obtain data from Stored Procedure (OLEDB)

B

blopmir

I´m try to load a recordset from Oracle Strored Procedure, if the
procedure don´t has input parameters i can do that, but if the
procedure need input parameter the webform fail.

This is my code

Try
Dim cnOra As New OleDbConnection("Provider=MSDAORA;Data
Source=XXX;user id=XX;password=XX;persist security info=false;")
Dim cmdPerson As New OleDbCommand("{call
PackPerson.person({resultset 3,ssn, fname, lname})}", cnOra)

'cmdPerson.Parameters.Add(New OleDbParameter("Cod",
OleDbType.Numeric, 9)).Value = 666223333

Dim daPerson As New OleDbDataAdapter(cmdPerson)
cnOra.Open()
Dim myReader As OleDbDataReader
myReader = cmdPerson.ExecuteReader()
While myReader.Read
Label1.Text = CStr(myReader.GetDecimal(0))
End While
myReader.Close()
cnOra.Close()

Catch exc As OleDb.OleDbException
Response.Write(exc.ToString)
End Try

Technical info:

.Net FrameWork 1.0
Language VB.Net
Oracle DB = 8.1.0.5
Client = OLEDB

What i need to execute my stored procedure like in oracle?

Regards
 
W

William Ryan eMVP

Blopmir:

Have you set the commandTYpe? It doesn't look like it... set
cmdPerson.CommandType = CommandType.StoredProcedure
blopmir said:
I´m try to load a recordset from Oracle Strored Procedure, if the
procedure don´t has input parameters i can do that, but if the
procedure need input parameter the webform fail.

This is my code

Try
Dim cnOra As New OleDbConnection("Provider=MSDAORA;Data
Source=XXX;user id=XX;password=XX;persist security info=false;")
Dim cmdPerson As New OleDbCommand("{call
PackPerson.person({resultset 3,ssn, fname, lname})}", cnOra)

'cmdPerson.Parameters.Add(New OleDbParameter("Cod",
OleDbType.Numeric, 9)).Value = 666223333

Dim daPerson As New OleDbDataAdapter(cmdPerson)
cnOra.Open()
Dim myReader As OleDbDataReader
myReader = cmdPerson.ExecuteReader()
While myReader.Read
Label1.Text = CStr(myReader.GetDecimal(0))
End While
myReader.Close()
cnOra.Close()

Catch exc As OleDb.OleDbException
Response.Write(exc.ToString)
End Try

Technical info:

Net FrameWork 1.0
Language VB.Net
Oracle DB = 8.1.0.5
Client = OLEDB

What i need to execute my stored procedure like in oracle?

Regards
 
B

blopmir

Thanks William if i put this piece of code the result is the same.

I have other StoredProcedure call PackPerson.allperson and this
procedure don´t need a input parameter and still working until
identify the comand type :( .


Maybe i have tu use (?)... i don´t khow

:(

Regards William
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top