0Day Forums
A connection was successfully established with the server, but then an error occurred during the pre-login handshake - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: Database (https://zeroday.vip/Forum-Database)
+---- Forum: Microsoft SQL Server (https://zeroday.vip/Forum-Microsoft-SQL-Server)
+---- Thread: A connection was successfully established with the server, but then an error occurred during the pre-login handshake (/Thread-A-connection-was-successfully-established-with-the-server-but-then-an-error-occurred-during-the-pre-login-handshake)

Pages: 1 2 3


A connection was successfully established with the server, but then an error occurred during the pre-login handshake - lost110818 - 07-31-2023

I am getting following error when i am trying to connect Production DB from Local Environment.

I was able to connect Production DB before, but suddenly i am getting following error, any idea?

>A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The handle is invalid.)

I was trying to run asp.net website in local PC, which has connection string of Production DB, following is stack trace for error I am getting in local environment.



> at MyWebsiteDAL.clsForumQuestion.SelectAll(Int32 CurrentPageIndex, Int32 PageSize) in D:\EDrive\My WebSites\MyWebsite\MyWebsite\MyWebsiteDAL\clsForumQuestion.cs:line 821
at CodeConnect.Default.Page_Load(Object sender, EventArgs e) in D:\EDrive\My WebSites\MyWebsite\MyWebsite\MyWebsite\Default.aspx.cs:line 100
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any idea what might have gone wrong here?


RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - yataghans375600 - 07-31-2023

**Solution**

1) Clean your VS.Net Solution

2) Rebuild Project.

3) Reset IIS

4) Run the project again.

Basically that solved my problem, but in my case i was not getting this error and suddenly my local environment starts giving me above error, so may be that trick work for me.


RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - tereznsjvofmvgv - 07-31-2023

You might want to check a few things:

1. You production server allows remote connections. (possible that someone turned this off, especially if you have a DBA)

2. Check your connection string. Sometimes if you are using an ip address or server name this will cause this error. Try both.




RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - fulk836495 - 07-31-2023

Had the same issue, the reason for it was BCrypt.Net library, compiled using .NET 2.0 framework, while the whole project, which used it, was compiling with .NET 4.0. If symptoms are the same, try download [BCrypt source code][1] and rebuild it in *release configuration* within .NET 4.0. After I'd done it "pre-login handshake" worked fine. Hope it helps anyone.


[1]:

[To see links please register here]




RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - equalises595330 - 07-31-2023

I had the same problem, I was storing session data in the database, the connection string had **Encrypt=True** in it, which I assume told the sql client to connect to the server in secure (SSL) mode, removing this helped!


RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - Deann698387 - 07-31-2023

I had this same problem and was having no luck with the suggested fixes. I then came across [this article][1] and saw the comment from Mirrh regarding a program called Sendori blocking the LSP. No idea how it got on my computer but there it was and removing it fixed the issue.

If the article doesn't work just check your Programs and uninstall Sendori if you see it.


[1]:

[To see links please register here]




RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - didargyqwjmayj - 07-31-2023

In my case it was:

`Persist Security Info=True;`

in my connection string that needed to be removed. Once I did that I no longer had issues.


RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - shawnavvxjkfxymp - 07-31-2023

I restarted **SQL Server (Sharepoint)** service and it solved the issue.


RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - immigrant207898 - 07-31-2023

Running the following command worked for me:

netsh Winsock reset

Seen at

[To see links please register here]




RE: A connection was successfully established with the server, but then an error occurred during the pre-login handshake - precinctionijaigkwh - 07-31-2023

I experienced this error and did all the suggestions from you guys here but none had any effect for my error.

I caught the culprit: if you are using ` *.ini` file for your system, you might want to check what server name was input there and make sure it is the same as the one in your web.config connection string.