iDB2 connection lifetime fails

127895 pts.
Tags:
.NET
DB2 SQL
iSeries
Visual Basic
I'm getting an error on my connection string. The error says The connectiong property is invalid.  It also says it must be IsGeneric. Not sure what I'm missing and I'v searched IBM's site.. It was not much help.  The reason I want to put a lifetime on connection is to prevent object locks. I can use the pooling=False but it slows the process down establishing the connection over and over. Here is the code.
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports System.io
Imports System.Net.Mail
Imports IBM.Data.DB2.iSeries

Public Class clsIBM_D2

Public LiveOrTest As String

Public Function Friedman_ExecuteNonQuery(ByVal strSQL As String, ByRef ErrorReason As String, ByVal strDiv As String, ByVal strWh As String) As Boolean

        Dim blnResponse As Boolean = False
        Dim strConnection As String

        If LiveOrTest = "LIVE" Then
           strConnection = "DataSource=10.10.16.16;userid=LIVEXML;password=LIVE1;DefaultCollection=EXTRANET;Connection Lifetime=60;"
        Else
           strConnection = "DataSource=10.10.16.16;userid=TSTXML;password=TEST1;DefaultCollection=EXTRANETST;Connection Lifetime=60;"
        End If

        Dim myConnection As New iDB2Connection(strConnection)
        myConnection.Open()
        Dim myCommand As New iDB2Command(strSQL, myConnection)
        'myCommand.DeriveParameters()
           Try
               myCommand.ExecuteNonQuery()
               blnResponse = True
           Catch ex As Exception
               ' Log Error
               ErrorReason = ex.Message
           End Try

        myConnection.Close()
        myConnection.Dispose()

        Return blnResponse


Software/Hardware used:
i-series, Sql Server,
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: