SQL Server DbConnection issue with Opti CMS12

Vote:
 

Hi All,

I'm running a local setup for Opti12 got all in place but when browsing my site I get this error:

Checking the Event Viewer entries found that theres is an issue when trying to connect to the DB, which is my local SQL Server, I see this error:

The error above does not metioned why the connection couldn't be established so I already double checked that my connection string is correct, the appseetings.json file is correct too. This is my connection string:

There is another error in the event viewer related with this:

I have 2 other OptiCM 12 projects in my local, those work ok.

Has anybody else seen these errors before?

Any help is appreciated.

Thanks,

#307633
Aug 29, 2023 13:28
Vote:
 

Definitely remove MultipleActiveResultSets as it casues issues when running in linux.  I would also remove Encrypt=false and Truseted_Connection= true.  Here is a sample connectionstring I use.

"Server=.;Database=database;User Id=user;Password=Password123!;TrustServerCertificate=True;"

Also you should check your sql server configuration and make sure named pipes is enabled.

#307634
Aug 29, 2023 15:04
Vote:
 

Run SQLServerManager15.msc (if you are running sql server 2019, or SQLServerManager16.msc if you are running sql server 2022), make sure these are all enabled 

then you need to restart Sql server instance for it to make effect.

Also this might be worth checking (I don't think it's necessary in this case, but it is recommended to enable it regardless)

open sql server management studio -> right click on the instance -> properties. in security tab select Mixed authentication 

#307673
Edited, Aug 30, 2023 10:01
Vote:
 

Thanks Mark and Quan!

I got this fixed following your suggestions, I also had to set the same connection string in both .json files, my local and appsettings.json.

The one set in the appsettings.json was causing issues not sure if that's expected so, I just set the same connection string in both, didn't troubleshoot further the issue.

#307959
Sep 04, 2023 15:01
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.