I am trying to call stored procedures from VB.NET. I am successful doing
this with V5R1, but it seems that the sintax for some functions have
chnaged. i.e. like the connection string. Can someone send me an example of
a stored proc call and what PTF's I may need for the database on the AS/400.
James C. Posey
Pinned topic VB.NET stored procedure problem with V5R2
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2003-09-17T15:32:19Z at 2003-09-17T15:32:19Z by SystemAdmin
Re: VB.NET stored procedure problem with V5R22003-09-17T02:17:30ZThis is the accepted answer. This is the accepted answer.Don't know of any changes - did you double check that you have the latest DB
Group PTF & iSeries Access Service Pack installed?
Kent Milligan, DB2 & BI team
PartnerWorld for Developers, iSeries
firstname.lastname@example.org (spam trick) GO HAWKEYES!!
(opinions stated are not necessarily those of my employer)
Re: VB.NET stored procedure problem with V5R22003-09-17T15:32:19ZThis is the accepted answer. This is the accepted answer.Yes they do work, but I had to play around quite a bit to make it work via
the OLEDB provider until a native dot net one is released. I also have yet
to be able to return an integer from a SP without passing it back through an
InOut parameter. There are other better ways to write thisd code, but
here's a real basic VB.Net (2k3) sample for you to build on:
Dim cn As New OleDbConnection("Provider=IBMDA400;Data
Source=MySystem;Default Collection = MyAppLib;CATALOG LIBRARY
LIST=MyAppLib;Persist Security Info=True;")
Dim da As New OleDbDataAdapter
Dim nrecs As Integer
da.SelectCommand = cn.CreateCommand()
da.SelectCommand.CommandText = "TESTCMD" ' Note: TestCmd in in
da.SelectCommand.CommandType = CommandType.StoredProcedure
da.SelectCommand.Parameters("DOCID").Value = 123456
da.SelectCommand.Parameters("RCODE").Value = 0
MsgBox("RCODE = " &
Catch e As Exception
MsgBox(e.Source & " - " & e.Message)