Topic
No replies
SystemAdmin
SystemAdmin
2826 Posts
ACCEPTED ANSWER

Pinned topic DB2 and vb.net Problem getting results from Stored procedure

‏2005-07-12T20:36:30Z |
Hi All,

I'm struck with this funny problem of calling a DB2 Stored Procedure in ASP.net(web app). This procedure has 10 input parameters and 5 output parameters.

Any help will be great. Here is the complete code which I'm using to call this stored procedure. There is no error in running this procedure. The only problem is it is not returning any result set.

Thanking you in anticipation.

Thanks:
Vineet
vineet.gupta@fmr.com

Dim PROD_ID_CODE As String
Dim ALT_INV_C As Char
Dim ELIG_CODE As Char
Dim CLS_PRC_AMT As Decimal
Dim DESCRIPTION As String
Dim OleDbReader As OleDb.OleDbDataReader
Dim OleDBStr As String = "Provider=""IBMDADB2.1"";Mode=ReadWrite;User ID=XXXXX;Data Source=XXXXX;Persist " & _
"Security Info=True;Password=""XXXXXX"""
Dim OleDbConn As New OleDb.OleDbConnection(OleDBStr)
Dim mySelectQuery As String = "call sydb2ft.fbspsm02('042991109',' ',' ','0001-01-01','0001-01-01','0001-01-01',' ',' ','A',' ');"
'Dim mySelectQuery As String = "SELECT EMPNO FROM A004859.EMP"
Dim OleDbCmd As New OleDb.OleDbCommand(mySelectQuery, OleDbConn)
OleDbCmd.CommandType = CommandType.Text
Try

OleDbConn.Open()
OleDbReader = OleDbCmd.ExecuteReader(CommandBehavior.CloseConnection)
While OleDbReader.Read()
PROD_ID_CODE = OleDbReader.Item("PROD_ID_CODE")
ALT_INV_C = OleDbReader.Item("ALT_INV_C")
ELIG_CODE = OleDbReader.Item("ELIG_CODE")
CLS_PRC_AMT = OleDbReader.Item("CLS_PRC_AMT")
DESCRIPTION = OleDbReader.Item("DESCRIPTION")
End While
Catch ex As Exception
ex.Message.ToString()
Finally
' OleDbReader.Close()
OleDbConn.Close()
End Try