DB2CONNECTION ISSUES..

G

Guest

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
 
F

Frans Bouma [C# MVP]

HARI said:
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


--
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top