Hello

I am facing a very different issue with db2 connect.
DBconnection string is
Database=mydatabase;UID=userid;PWD=password;pooling = false

mydatabase is a system DSN created while configuring db2 node.

Sometimes all of sudden i am getting this issue error
"The type initializer for "IBM.Data.DB2.DB2Connection" threw an
exception."

at IBM.Data.DB2.DB2Connection..ctor(String connectionString)
at
Microsoft.Practices.EnterpriseLibrary.Data.DB2.DB2Database.GetConnection()

at
Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DBCommandWrapper command, DataSet dataSet

But after restarting the IIS everything works fine for 1/2 days and
again starts same issue.
In some developer machines i am not at all getting this issue.

#1) asp.net and given permission to IWAM_USR under which worker process
is running.
#2) given permission to SQLLIB folder to IWAM_USR.
#3)Added IWAM_USR to the db2users group.
#4) Reregistered DB2client 8.1.7

plz help me out if u have any solutions..
Thanks in advance

Re: DB2CONNECTION ISSUES.. by Frans

Frans
Fri Mar 03 03:01:36 CST 2006

HARI PRASD BARU wrote:

> Hello
>
> I am facing a very different issue with db2 connect.
> DBconnection string is
> Database=mydatabase;UID=userid;PWD=password;pooling = false
>
> mydatabase is a system DSN created while configuring db2 node.
>
> Sometimes all of sudden i am getting this issue error
> "The type initializer for "IBM.Data.DB2.DB2Connection" threw an
> exception."
>
> at IBM.Data.DB2.DB2Connection..ctor(String connectionString)
> at
> Microsoft.Practices.EnterpriseLibrary.Data.DB2.DB2Database.GetConnecti
> on()
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DBComm
> andWrapper command, DataSet dataSet
>
> But after restarting the IIS everything works fine for 1/2
> days and again starts same issue.
> In some developer machines i am not at all getting this issue.
>
> #1) asp.net and given permission to IWAM_USR under which worker
> process is running.
> #2) given permission to SQLLIB folder to IWAM_USR.
> #3)Added IWAM_USR to the db2users group.
> #4) Reregistered DB2client 8.1.7
>
> plz help me out if u have any solutions..
> Thanks in advance

Your connection string is wrong. You don't need a DSN, that's for
ODBC. Your connection string has to have the format:
"Database=SAMPLE;Server=MyServer;UID=Foo;PWD=Bar;"

FB


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Re: DB2CONNECTION ISSUES.. by HARIPRASDBARU

HARIPRASDBARU
Fri Mar 03 11:39:27 CST 2006

Hey Frans

I am not mentioning DSN name in my connectionstring.
Database=SAMPLE;UID=Foo;PWD=Bar;pooling=false;

You mean it will look for DSN first and then look for DB2alias which is
configured from DB2client.

"Frans Bouma [C# MVP]" wrote:

> HARI PRASD BARU wrote:
>
> > Hello
> >
> > I am facing a very different issue with db2 connect.
> > DBconnection string is
> > Database=mydatabase;UID=userid;PWD=password;pooling = false
> >
> > mydatabase is a system DSN created while configuring db2 node.
> >
> > Sometimes all of sudden i am getting this issue error
> > "The type initializer for "IBM.Data.DB2.DB2Connection" threw an
> > exception."
> >
> > at IBM.Data.DB2.DB2Connection..ctor(String connectionString)
> > at
> > Microsoft.Practices.EnterpriseLibrary.Data.DB2.DB2Database.GetConnecti
> > on()
> > at
> > Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DBComm
> > andWrapper command, DataSet dataSet
> >
> > But after restarting the IIS everything works fine for 1/2
> > days and again starts same issue.
> > In some developer machines i am not at all getting this issue.
> >
> > #1) asp.net and given permission to IWAM_USR under which worker
> > process is running.
> > #2) given permission to SQLLIB folder to IWAM_USR.
> > #3)Added IWAM_USR to the db2users group.
> > #4) Reregistered DB2client 8.1.7
> >
> > plz help me out if u have any solutions..
> > Thanks in advance
>
> Your connection string is wrong. You don't need a DSN, that's for
> ODBC. Your connection string has to have the format:
> "Database=SAMPLE;Server=MyServer;UID=Foo;PWD=Bar;"
>
> FB
>
>
> --
> ------------------------------------------------------------------------
> Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
> My .NET blog: http://weblogs.asp.net/fbouma
> Microsoft MVP (C#)
> ------------------------------------------------------------------------
>