I am using MVC method and trying to connect to DB2. I have successfully got my connection string using Mysql but when I am going to connect to DB2 I am having this error message:
Exception thrown: 'System.ArgumentException' in IBM.Data.DB2.dll
An exception of type 'System.ArgumentException' occurred in IBM.Data.DB2.dll but was not handled in user code
Invalid argument
The error appears on my connection string code:
string constr = ConfigurationManager.ConnectionStrings["ConnStringDb2"].ConnectionString;
using (DB2Connection con = new DB2Connection(constr))
and here is my connection string setup from my web.config
<connectionStrings>
<add name="ConnStringDb2" connectionString="DATABASE=DB;HOSTNAME=Myhost;PORT=50000;UID=user;PWD=pass;" />
</connectionStrings>
I already installed the following:
IBM data client
IBM database add-ins
Is there any items that I am missing or need to add to my connection string or is the format for my connection is invalid. Any suggestion and comments. TIA.