Home All Groups Group Topic Archive Search About
Author
1 Mar 2007 2:56 PM
JimHeavey
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?

Author
2 Mar 2007 8:46 AM
Frans Bouma [C# MVP]
JimHeavey wrote:

Show quote
> 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#)
------------------------------------------------------------------------
Author
2 Mar 2007 11:35 AM
Sundar Narasiman
Do you have IBM's DB2 connect in the machine where the Data Access component
lives

--
Thanks & Regards,
Sundar Narasiman


Show quote
"JimHeavey" wrote:

> 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?
>
>

AddThis Social Bookmark Button