DB2 Connection Issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can connect to one db2 database through my application just fine. But when
I attempt to connect to another database in another application, I am getting
errors. When I create the connection object, I see the following on the
"ServerVersion" property: "ServerVersion = '_OledbConn.ServerVersion' threw
an exception of type 'System.InvalidOperationException'", but it throws not
exception. When I create a command object and attempt to execute the
command, I then do get an exceptions of "[System.Data.OleDb.OleDbException] =
{" SQL1013N The database alias name or database name \"\" could not be
found. SQLSTATE=42705"}".

If I go to my desktop and create a ".udl" object to connect to the database,
it connects just fine. I took the information out of this file and used it
for my connection object. Likewise, if I go into the control panel and go
into the ODBC connections, I can connect to this data source just fine.

The db2 table that I am able to successfully able to connect to is on
another box, but I'm not sure that has to do with anything.

Any ideas?
 
JimHeavey said:
I can connect to one db2 database through my application just fine.
But when I attempt to connect to another database in another
application, I am getting errors. When I create the connection
object, I see the following on the "ServerVersion" property:
"ServerVersion = '_OledbConn.ServerVersion' threw an exception of
type 'System.InvalidOperationException'", but it throws not
exception. When I create a command object and attempt to execute the
command, I then do get an exceptions of
"[System.Data.OleDb.OleDbException] = {" SQL1013N The database alias
name or database name \"\" could not be found. SQLSTATE=42705"}".

If I go to my desktop and create a ".udl" object to connect to the
database, it connects just fine. I took the information out of this
file and used it for my connection object. Likewise, if I go into
the control panel and go into the ODBC connections, I can connect to
this data source just fine.

The db2 table that I am able to successfully able to connect to is on
another box, but I'm not sure that has to do with anything.

Any ideas?

Well, it might be wise to use the native DB2 provider from IBM. It's
in the latest client-access client.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

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

Similar Threads

issue with ODBC connection to DB2 4
[C#] Connect to IBM DB2 database 3
DB2 - OLEDB 1
DB2 connection 4
First Connection To DB2 5
db2 connection problem 1
DB2 and OLEDBDataReader 3
DB2 ODBC 4

Back
Top