I am working on a web application migration project to dotnet where i need rewrite the DB2 connection in the new code. I am not able to connect to DB2 database via .net code whereas i am able to do a test connection via DB2 CLI on Windows machine.
Getting below error:
“ERROR [42705] [IBM] SQL1013N The database alias name or database name “” could not be found. SQLSTATE=42705rn”
I am using below template for DB2:
String MyDb2ConnectionString = “database=alias;uid=userid;pwd=password;”; DB2Connection MyDb2Connection = new DB2Connection(MyDb2ConnectionString); MyDb2Connection.Open();
Can anybody please help me to connect to DB2 database ?