I have no issues connecting using the IBM i Access for Windows ODBC data source. However, I am trying to use Entity Framework and I thought it required the Net.IBM.Data.Db2 package.
Original Message:
Sent: Wed December 20, 2023 02:31 AM
From: Robert van der Doelen
Subject: #DB2 IBM.EntityFrameworkCore
Hi Richard,
You are using the correct connection string properties.
Now you have to get a proper license, see for example https://stackoverflow.com/questions/70446909/license-error-while-making-connection-ibm-db2-using-python-and-ibm-db-library.
Contact your DBA how to get one.
------------------------------
Robert van der Doelen
Original Message:
Sent: Tue December 19, 2023 11:33 AM
From: Richard Rothe
Subject: #DB2 IBM.EntityFrameworkCore
I think I am using the correct values in the connection string because now I am getting the error about a license being required.
I understand there may be a trial license available, but not sure how to request one.
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
------------------------------
Richard Rothe
Original Message:
Sent: Mon December 18, 2023 11:54 AM
From: Robert van der Doelen
Subject: #DB2 IBM.EntityFrameworkCore
Hey Richard,
I use the same assemblies as you are using, so that looks good.
The connection string in my app looks like this:
"Server=xxx.xxx.com:446;Pooling=true;Connection Lifetime=300;Connection Reset=false;CurrentSchema=SchemaName;Database=DbName;UserID=xxxxxx;password=xxxxxx;IsolationLevel=Chaos"
Contact your administrator for the proper databasename and schemaname.
The IsolationLevel I have to use it that way, but I'm looking for a better solution.
Regards,
Robert
------------------------------
Robert van der Doelen
Original Message:
Sent: Fri December 15, 2023 09:02 PM
From: Richard Rothe
Subject: #DB2 IBM.EntityFrameworkCore
Hi Robert,
I have created a C# 7 Web API with EF using Net.IBM.Data.Db2 and IBM.EntityFrameworkCore. It appears to be connecting to the iSeries and then returns :
IBM.Data.Db2.DB2Exception (0x80004005): ERROR [08004] [IBM] SQL30061N The database alias or database name "filename " was not found at the remote node. SQLSTATE=08004
Connection string :
"Server=xxx.xxx.com:446; Database=filename; UID=*****; PWD=*****;"
Can you give me some insight on what drivers you are using ? What does your connection string look like ?
There is very little information out there regarding how to configure this. Any help is appreciated !
------------------------------
Richard Rothe
Original Message:
Sent: Fri December 01, 2023 05:19 AM
From: Robert van der Doelen
Subject: #DB2 IBM.EntityFrameworkCore
Hi,
I have implemented IBM.EntityFrameworkCore in .Net 7.0 apllication.
Created a DbContext and implemented OnConfiguring:
![](https://dw1.s81c.com//IMWUC/MessageImages/161fcc3accaf49ebaa3d856e35db49bc.png)
I experience a delay of approximately 15 second when the connection opens the first time.
Is this a known problem? Or has it something to do with de settings of the server.
Best regards,
Robert
------------------------------
Robert van der Doelen
------------------------------