Chris,
I'm sorry, my exposure to .net is from Craig Pelkie's .NET for RPG
programmers course. I'm a very experienced ILE RPG programmer, but a
total newbie to .NET. What do I do in the partial class to connect and
disconnect?
Thanks again,
Lee
-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of ibm
Sent: Monday, September 14, 2009 11:51 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] IIS server not sending user id
I would recommend to make a separate class that Imports from
IBM.Data.DB2.iSeries. This will make your class reusable; you don't
want to write DB2 connect code in every single asp.net page you create.
This way within your ASP.NET _default page you can instantiate your DB2
ADO class :
Public Class myDB2ADOProvider
' insert the code I pasted here
End Class
Partial Class _Default
Private _myDB2provider as myDB2ADOProvider
...
End Class
Also, remember that all private variables are disposed on asp.net page
callback. So you will have to save your _myDB2provider into a Session
variable and use it from there.
-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Lee Arrison
Sent: Monday, September 14, 2009 10:27 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] IIS server not sending user id
Chris,
This is my first attempt at .net and you have me totally confused. I
copied what I thought was the pertinent parts and got code errors. The
following is what I did.
Imports IBM.Data.DB2.iSeries
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Private cn_connString As String = ""
Private cn As iDB2Connection
Private cn_iSeriesFQDN As String = "myIseries.domain.com"
Private cn_user As String = ""
Private cn_pass As String = ""
Private _ConvertByte As Boolean = False
Public Sub New(ByVal iSeriesFQDN As String, ByVal user As String,
ByVal pass As String, Optional ByVal ConvertByte As Boolean = True)
cn_iSeriesFQDN = iSeriesFQDN
cn_user = user
cn_pass = pass
_ConvertByte = ConvertByte
cn_connString = "DataSource=" & cn_iSeriesFQDN & _
";UserID=" & cn_user & _
";Password=" & cn_pass
cn_pass = ""
End Sub
Thanks for your help,
Lee
--
This is the .net use with the System i (SystemiDotNet) mailing list To
post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/systemidotnet.
--
This is the .net use with the System i (SystemiDotNet) mailing list To
post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/systemidotnet.
As an Amazon Associate we earn from qualifying purchases.