|
-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx [mailto:systemidotnet-
bounces@xxxxxxxxxxxx] On Behalf Of DLee@xxxxxxxx
Sent: Tuesday, October 27, 2009 12:15 PM
To: systemidotnet@xxxxxxxxxxxx
Subject: [SystemiDotNet] C# code help
I am a c# newbie. could use some help.
I'm testing a stored procedure I created on the iSeries to insure it
will return the data to pc network programmers when called.
Below is the code.
The program is working fine to display the data fields until I added
the code for dr.GetiDB2Integer(5).ToString() This one happens to be a
packed data field size 13.2 on the iSeries database and I haven't found
anything on the internet addressing packed data with regard to C#.
I have a feeling I will have to change this to signed numeric.
The file data fields are defined below also
Any help would be appreciated.
Line Page Dup Case Null Name Type Length Dec
Co Code K01 SECOCD A
2
Agent Number K02 SEAGNT A 10
Insurance Type K03 SETYP A 1
Year Month K05 SEYYMM S 6 0
Period K04 SEPERD A 2
Net Premium SENPRM P
13
2
Rein Prem SERPRM P
13
2
Claims Paid SECLMP P
13
2
Claim Reserve Beg SECRVB P 13 2
Claim Reserve End SECRVE P 13 2
.
using System;
using System.Collections.Generic;
using System.Text;
using IBM.Data.DB2.iSeries;
namespace getRem126SP
{
class Program
{
[STAThread]
static void Main(string[] args)
{
iDB2Connection cn = new iDB2Connection("DataSource=SWBCDEV;
UserID=CRPRDQUA; Naming=System");
cn.Open();
iDB2Command cmd = new iDB2Command("CALL
CRPRDLIBTS/REM126SP()", cn);
//cmd.CommandType =
System.Data.CommandType.StoredProcedure;
cmd.DeriveParameters();
iDB2DataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Console.WriteLine("{0} {1} {2} {3}{4}",
dr.GetiDB2Char(0).Value,
dr.GetiDB2Char(1).Value,
dr.GetiDB2Char(2).Value,
dr.GetiDB2Char(3).Value,
dr.GetiDB2Char(4).Value,
dr.GetiDB2Integer(5).ToString());
}
dr.Close();
cmd.Dispose();
cn.Close();
}
}
}
Regards,
Darrell
SWBC
9311 San Pedro Ave., Suite 600
San Antonio, TX 78216
Visit our website at www.swbc.com
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.