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=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";
DB2Connection myConnection =
new DB2Connection(myConnString);
myConnection.Open();
} catch (Exception e) {Debug.WriteLine(e.ToString());}
The error is:
IBM.Data.DB2.DB2Exception: 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.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual studio
projects\dot400\form1.cs:line 205
If I use Database=Sample, or Database=$HAWLIB, the error is:
IBM.Data.DB2.DB2Exception: 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.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual 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.168.1.43;UID=XXXX;PWD=XXXX";
this isn't correct.
Use something like:
"Database=SAMPLE;Server=192.168.1.43;UID=XXXX;PWD= YYYY;"
or with portnumber:
"Database=SAMPLE;Server=192.168.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...updated almost daily
http://kentpsychedelic.blogspot.com
Texeme Textcasting Technology
http://texeme.com