473,789 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IBM DB2 Connector throws exception with .Connect() in .net


I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.1 68.1.43;UID=XXX X;PWD=XXXX";
DB2Connection myConnection = new DB2Connection(m yConnString);
myConnection.Op en();

Throws this error on the .Open() method:

IBM.Data.DB2.DB 2Exception: ERROR [HY009] [IBM] CLI0124E Invalid
argument value. SQLSTATE=HY009
at IBM.Data.DB2.d. a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB 2ConnPool.a(DB2 Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB 2Connection.Ope n()
at dot400.Form1.pr ocessSqlRequest (String qs, Int32 q) in
c:\documents and settings\jbailo \my documents\visua l studio
projects\dot400 \form1.cs:line 205
How can I diagnose this?

Does my connection string look right?

The machine name on our network is AS400. If I use that as the
DATABASE name, it throws another error:

IBM.Data.DB2.DB 2Exception: ERROR [58031] [IBM] SQL1031N The database
directory cannot be found on the indicated file system. SQLSTATE=58031

at IBM.Data.DB2.d. a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB 2ConnPool.a(DB2 Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB 2Connection.Ope n()
at dot400.Form1.pr ocessSqlRequest (String qs, Int32 q) in
c:\documents and settings\jbailo \my documents\visua l studio
projects\dot400 \form1.cs:line 205
I can access this as400 using OleDb ( the SQLDA400 data provider that is
part of the CAE ), but I want to deploy my application using the
Here is the connector class api doc:

http://publib.boulder.ibm.com/infoce...ClassTopic.htm
--

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #1
6 4377
C.E.O. Gargantua wrote:

I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.1 68.1.43;UID=XXX X;PWD=XXXX";


this isn't correct.
Use something like:
"Database=SAMPL E;Server=192.16 8.1.43;UID=XXXX ;PWD=YYYY;"
or with portnumber:
"Database=SAMPL E;Server=192.16 8.1.43:1533;UID =XXXX;PWD=YYYY; "

At least that's how I construct the connection strings, which do work.
I had similar issues like the ones you describe. Also if usernames
apparently don't match you get this kind of error.

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

I now see a new class of error. Are there additonal parameters I should
use in my Connection String? I am still not sure what a Database
is...MARDRPALL is a File in the $HAWLIB. Should I use the Library name?

Using the connection string:

try {

string myConnString =
"Database=MARDR PALL;Server=192 .168.1.43;UID=J BAILO;PWD=TOOTH PICK1;";

DB2Connection myConnection =
new DB2Connection(m yConnString);

myConnection.Op en();

} catch (Exception e) {Debug.WriteLin e(e.ToString()) ;}
The error is:

IBM.Data.DB2.DB 2Exception: ERROR [HY009] [IBM] CLI0124E Invalid
argument value. SQLSTATE=HY009
at IBM.Data.DB2.d. a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB 2ConnPool.a(DB2 Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB 2Connection.Ope n()
at dot400.Form1.pr ocessSqlRequest (String qs, Int32 q) in
c:\documents and settings\jbailo \my documents\visua l studio
projects\dot400 \form1.cs:line 205

If I use Database=Sample , or Database=$HAWLI B, the error is:

IBM.Data.DB2.DB 2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1. 43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

at IBM.Data.DB2.d. a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB 2ConnPool.a(DB2 Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB 2Connection.Ope n()
at dot400.Form1.pr ocessSqlRequest (String qs, Int32 q) in
c:\documents and settings\jbailo \my documents\visua l studio
projects\dot400 \form1.cs:line 205

So it seems like MARDRPALL is a database...
Frans Bouma [C# MVP] wrote:
C.E.O. Gargantua wrote:

I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.1 68.1.43;UID=XXX X;PWD=XXXX";

this isn't correct.
Use something like:
"Database=SAMPL E;Server=192.16 8.1.43;UID=XXXX ;PWD=YYYY;"
or with portnumber:
"Database=SAMPL E;Server=192.16 8.1.43:1533;UID =XXXX;PWD=YYYY; "

At least that's how I construct the connection strings, which do
work. I had similar issues like the ones you describe. Also if usernames
apparently don't match you get this kind of error.

Frans.

--
incognito...upd ated almost daily
http://kentpsychedelic.blogspot.com

Texeme Textcasting Technology
http://texeme.com

Nov 16 '05 #3
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I should
use in my Connection String? I am still not sure what a Database
is...MARDRPALL is a File in the $HAWLIB. Should I use the Library name?
I'm not sure, but what I do know is that with an AS/400 you get DB2
client software, with which you can administrate the DB2 instance on the
AS/400. With that one you could browse teh DB2 instance and see which
catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDR PALL;Server=192 .168.1.43;UID=J BAILO;PWD=TOOTH PICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try the
local dns name for 192.168.1.43?

Frans.

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

Ok, so someone told me that the whole machine is a database, so I used
this connection string:

string myConnString =
"Database=as400 ;Server=192.168 .1.43;UID=JBAIL O;PWD=TOOTHPICK 1;";

That generated a new error which seems to indicate a problem with the
protocol specification.. .

IBM.Data.DB2.DB 2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1. 43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?

I'm not sure, but what I do know is that with an AS/400 you get DB2
client software, with which you can administrate the DB2 instance on the
AS/400. With that one you could browse teh DB2 instance and see which
catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDR PALL;Server=192 .168.1.43;UID=J BAILO;PWD=TOOTH PICK1;";

Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try
the local dns name for 192.168.1.43?

Frans.

--

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #5
C.E.O. Gargantua wrote:

Ok, so someone told me that the whole machine is a database, so I used
this connection string:
yes, because on an AS/400 you work inside the DB2 instance (not
entirely true, but lets say you do for simplicity).

However, what you did is not correct. Btw, The DB2 UDB .net provider
works with AS/400 if DB Connect is installed on the AS/400. Is that the
case?

Frans.

string myConnString =
"Database=as400 ;Server=192.168 .1.43;UID=JBAIL O;PWD=TOOTHPICK 1;";

That generated a new error which seems to indicate a problem with the
protocol specification.. .

IBM.Data.DB2.DB 2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1. 43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?


I'm not sure, but what I do know is that with an AS/400 you get
DB2 client software, with which you can administrate the DB2 instance
on the AS/400. With that one you could browse teh DB2 instance and see
which catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDR PALL;Server=192 .168.1.43;UID=J BAILO;PWD=TOOTH PICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try
the local dns name for 192.168.1.43?

Frans.


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #6
Frans Bouma [C# MVP] wrote:
However, what you did is not correct. Btw, The DB2 UDB .net provider
works with AS/400 if DB Connect is installed on the AS/400. Is that the
case?
How can I confirm whether it's installed or not? What command?

I have been able to use OleDb to connect...does this imply that DB
Connect is installed ?




Frans.

string myConnString =
"Database=as400 ;Server=192.168 .1.43;UID=JBAIL O;PWD=TOOTHPICK 1;";
That generated a new error which seems to indicate a
problem with the protocol specification.. .

IBM.Data.DB2.DB 2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1. 43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:

I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?


I'm not sure, but what I do know is that with an AS/400 you get
DB2 client software, with which you can administrate the DB2 instance
on the AS/400. With that one you could browse teh DB2 instance and
see which catalogs there are..

Using the connection string:

try {

string myConnString =
"Database=MARDR PALL;Server=192 .168.1.43;UID=J BAILO;PWD=TOOTH PICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you
try the local dns name for 192.168.1.43?

Frans.



--
Texeme
http://texeme.com

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
14698
by: Raj | last post by:
Hi! Every time my applicaiton call "System.Diagnosis.Process.GetProcesses() and some other related APIs in dotnet framework, it throws the following exception: "An unhandled exception of type 'System.InvalidOperationException' occurred in system.dll. Additional information: Process performance counter is disabled, so the requested operation cannot be performed." My application works fine in my development machine as well as another...
0
1904
by: Mark Vuksani | last post by:
Hi, I have a trigger like this (simplified to illustrate the problem): -------- CREATE TRIGGER Test ON . FOR INSERT, UPDATE, DELETE AS RAISERROR( 'test trigger error !', 16, 1)
7
19762
by: C.E.O. Gargantua | last post by:
I am using the IBM DB2 Connector class of the Redistributable DB2 Run-Time Client Lite in a c# .net application using Visual Studio. Running the code: string myConnString = "DATABASE=192.168.1.43;UID=XXXX;PWD=XXXX"; DB2Connection myConnection = new DB2Connection(myConnString); myConnection.Open(); Throws this error on the .Open() method:
0
3678
by: Mike Schilling | last post by:
I have some code that calls methods reflectively (the method called and its parameters are determined by text received in a SOAP message, and I construct a map from strings to MethodInfos). The code that does the call looks roughly like: try { // do reflective call response = method.Invoke(obj, params); }
4
1769
by: frog | last post by:
Hi, all: I tried to call Server.Execute in Application_Start and got exception. Any help is appreciated You might ask why I want to do that in the first place. Well, I need to start a background thread in the Application_Start. This background thread
1
1113
by: Richard | last post by:
Hi. I subclassed a ListView to give it the capability to sort by a column when the column header is clicked and it works fine. The problem is when the listview gets refreshed, all items are cleared and then read from the database and the listview is repopulated. Here it throws an exception when the 2nd item is added to the listview, apparently because it tries to compare it with the first to sort them out. Is there an easy way to sort a...
0
1004
by: Chris Reuter | last post by:
I've been trying to start a particular external program from Python using os.spawnv(). This works perfectly under Linux but under Windows, it first runs the program, then throws an OSError exception with the tuple (0, 'Error'): >>> spawnv(P_WAIT, 'c:/mctools/bin/mc', ) Archelon Tool Driver 3.09 2005/02/16 No input file was given. Traceback (most recent call last):
3
3936
by: Sebastian M. Rouaiha | last post by:
Hi. I have a problem. When drawing into a graphics context I sometimes get access violation exceptions and I can't figure out why. It seems to have to do with the use of custom dashes. If I change the dash I get the exception. Following is a code example: Pen pLine = new Pen(colBkg); // colBkg is a valid color // fill area with background color. g is a valid graphics context
6
3233
by: Samuel | last post by:
Hi, I am trying to get the files from this tutorial to work: http://www.grisby.org/presentations/py10code.html Direct link to the files: http://www.grisby.org/presentations/py10code/adder.idl http://www.grisby.org/presentations/py10code/adderServer.py It produces the following error:
2
4559
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you can. I'm using Eclipse 3.2.2 and I have installed mysql-connector-java-5.0.6-bin.jar. I am trying to connect to SQL Enterprise Manager version 8.0 innstall on a Windows 2003 Server Enterprise Edition. I have been able to successfully test...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.