Reputation: 333
I'm a beginner in ASP.NET Core, SQL and DBVisualizer (in web programming in general).
I would like to visualize my database with DBVisualizer but I get an error :
An error occurred while establishing the connection:
Long Message:
Failed to connect TCP/IP to host localhost, port 5041. Error: “The driver received an unexpected preconnect response.
Review the connection properties and verify that an instance of SQL Server is running on the host and accepting TCP/IP connections to the port. This driver can only be used with SQL Server 2005 or later.
ClientConnectionId:41197c49-49ad-4191-8bdc-0dd7905eaede
FYI I translated everything after Long Message:
from French to English.
In Program.cs
, I create the DB context like that :
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
My connection string in appsettings.json
is :
"ConnectionStrings": {
"DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=RestoCommandDB;Integrated Security=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
},
Then on DBVisualizer side, I configure my connection like that :
I have no userId or password that I know of. The ping works.
Thanks for your help
Upvotes: 0
Views: 87