|
Bob, the way I do it is to load the iSeries Access .Net Db2 Provider and
call a stored procedure on the iSeries. Below is a code snippet. You
have to create the stored procedure on the iSeries.
using IBM.Data.DB2.iSeries;
try
{
cn.Open();
}
catch (iDB2Exception ex)
{
HandleError("An error occurred on cn.Open()", ex);
return;
}
//************************************************************
// B: define stored procedure - GENERAL parameter style
//************************************************************
String sp = "call YourLibrary.YourProgram(@Parm1, @Parm2)";
iDB2Command cmd;
try
{
//*************************************************************
// C: set up command, derive parameters, set input parm values
//*************************************************************
cmd = new iDB2Command(sp, cn);
cmd.CommandType = System.Data.CommandType.Text;
cmd.DeriveParameters();
//*************************************************************
// D: Request - get value or set to default
//*************************************************************
cmd.Parameters["@Parm1"].Value = 'initial Value if you need
it';
//*************************************************************
cmd.Parameters["@Parm2"].Value = String.Empty;
cmd.ExecuteNonQuery();
String TestParm = cmd.Parameters["@Parm2"].Value.ToString();
}
Catch
{
// Do Error Stuff
}
HTH
Bruce Collins
IT Architect
AAA Cooper Transportation
-----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l- bounces@xxxxxxxxxxxx] On Behalf Of Bob O. Sent: Monday, February 19, 2007 9:19 AM To: midrange-l@xxxxxxxxxxxx Subject: Call iSeries program from C# program I have a VARPG project that I'm converting (well duplicating) to a
C#
web application. I'm also duplicating it to a standalone C# Windows program as well just to see which one will work best. It was easy enough to call the progam on the iSeries from the VARPG program that builds a file. I need to do the same thing in the C# program if it is possible. Anybody know it this is possible?
---------------------------------------------------------------------
- Don*t miss your chance to WIN 10 hours of private jet travel from Microsoft(R) Office Live -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.