How do you catalog databses for db2 directory to us NET7.0 with Visual Studio 2022

William Phillips 0 Reputation points
2023-07-18T04:04:33.9433333+00:00

Connection to ZOS DB2 works with .NET Framework 4.8.1 using Visual Studio 2022. I can connect with command line just fine also.

If I just use Database=,user=,pwd= get the following:

IBM.Data.Db2.DB2Exception (0x80004005): ERROR [42705] [IBM] SQL1013N The database alias name or database name "" could not be found. SQLSTATE=42705

If I add server:port I get the following:

IBM.Data.Db2.DB2Exception (0x80004005): ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968

Community Center | Not monitored
{count} votes

2 answers

Sort by: Most helpful
  1. William Phillips 0 Reputation points
    2023-07-19T03:41:53.6433333+00:00

    If I just use Database=ZOSDBRMT,user=IBMUSER,pwd=PASSWORD get the following:

    I had them filled in, I just wasn't going to post them. I'm working with VS 2022 using NET7.002. It seems to not recognize the alias database cataloged in the directory. It says it can't find the alias. If I give it the Database=DALLASC it, the actual remote database name then it finds it, but it says the license isn't valid or it doesn't find it. With a regular C# Forms, .NET 4.8.1 and the V11.5.8 DB2 installation it finds the database and connects fine. I was wondering if the NET7.002 is doing something different. I down loaded the nuget NET7.IBM.Data.DB2 NET provider.

    0 comments No comments

  2. William Phillips 0 Reputation points
    2023-07-22T19:33:10.8266667+00:00

    NET 7 is forcing NET 7 drivers whether it be IBM or MS framework. I tried referencing older DB2 LUW driver in add reference in solution, but it loads NET 7 driver anyway in assemblies. I can't seem to get it to load IBM..DB2.DB2, it overrides with IBM.DB2.Db2.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.