473,776 Members | 1,606 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 12 '05 #1
7 19759
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 12 '05 #2

I will try that!

However, what is DATABASE?

I am new to the iSeries and I am familiar with the $Library.File.M ember
syntax but not "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.


--

http://texeme.com
Textcasting Technology

Nov 12 '05 #3

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 12 '05 #4
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 12 '05 #5

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 12 '05 #6
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 12 '05 #7
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 12 '05 #8

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)
0
3677
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); }
6
4377
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:
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...
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
9628
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
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
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...
0
10122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4031
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
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.