First test local, going to do a remote next
Remote test to one of our data centers, faster than the local connection
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've got two very basic c# applications. One targeting .NET Fremework 4.7.2, the other targeting .NET 5.0. They were created at the same time, they are very simple programs that just connect to an SQL database using a connection string, perform a simple query, then disconnect.
I'm amazed at the difference in connection time between the two versions. The .net fremework 4.7 version will connect in 2.5 seconds.
The .NET 5.0 verison takes over 22 seconds to connect. Once connected the data transfer is fast enough, but the initial connection is crazy.
We even tried .NET 6.0 but got the same results.
Has anyone seen anything like this?
Here's the connection string:
connstring= "Server=servername\instancename;User Id=username;Password=***;Encrypt=false;"
SqlConnection conn = new SqlConnection(connString)
We're using System.Data.SqlClient
First test local, going to do a remote next
Remote test to one of our data centers, faster than the local connection
Doubtful it is the connection. I've never had an issue with connecting with .NET Core projects.
Checkout the following project, I connect in less than one second.
My guess is dAdapter.Fill(ds);
connects fine but something else is going on other than the actual opening of the connection.