C
C#2y ago
Temptica

❔ ASP.NET api Timeout when fetching data from DB

So I’m working on an ASP.NET Core api with a database. It’s all running on localhost. I used EFC to perform data migration and that worked successfully. I know that my connection string is correct, and that data can be fetched in an instance. But when I perform a .find on my DBContext, I only get a time-put error after 15ish seconds. "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)" Let me know what other info you need
3 Replies
Jimmacle
Jimmacle2y ago
is the sql server running? the error's pretty clear, it can't connect to your database at all
Temptica
TempticaOP2y ago
It’s running yes That’s what I don’t get, as I can perform a database-update with the same connection string but somehow it doesn’t work anymore once there is an api call Oh and for testing purposes the login of the db has full admin rights to the db so that’s probably not why either I’ve also checked the database logs, but no errors appeared
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?