ExecuteReader requires an open connection. The connection's current state is Closed.

DB2Connection Connection string is not working. Currently Im in .net core application and installed IBM.data.db2.core through NuGet package.

using (DB2Connection con = new DB2Connection("Server="xxxxx";Database=xxxxxx;UID=xxxx;PWD=xxxxxx"))

Can anyone please help .

ExecuteReader requires an open connection. The connection's current state is Closed.

1 answer

Did you open the connection?
Please provide the code, it's hard to tell what's wrong with this little information...