SqlClient: Microsoft.Data.SqlClient 2.0.0 A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: HTTP Provider, error: 0 - )
After a NuGet update of Microsoft.Data.SqlClient from 1.1.3 to 2.0.0 I am no longer able to connect to SQL Server 2017 14.0.3294.2 (latest update). I get an error: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: HTTP Provider, error: 0 - )
Code:
using (var cnn = new SqlConnection(CreateConnectionString(server, port, LoginDatabaseName, Username, Password)))
{
var cmd = new SqlCommand("uspGetDatabasesByLogin", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@LoginName", login));
try
{
cnn.Open();
}
catch (SqlException ex)
{
//it goes here
greska = ex;
return ret;
}
...
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (10 by maintainers)
Thanks, missed your update to your original post
Maybe exception descriptions should be more accurate,descriptive and maybe give you some pointers. 😉
Poslano iz programa Poštahttps://go.microsoft.com/fwlink/?LinkId=550986 za Windows 10
Pošiljatelj: Erik Ejlskov Jensenmailto:notifications@github.com Poslano:17. lipnja 2020. 19:59 Primatelj: dotnet/SqlClientmailto:SqlClient@noreply.github.com Kopija: hovekmailto:hove1982@hotmail.com; Mentionmailto:mention@noreply.github.com Predmet: Re: [dotnet/SqlClient] Microsoft.Data.SqlClient 2.0.0 A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: HTTP Provider, error: 0 - ) (#609)
Maybe it would be helpful to have all breaking changes listed in on place?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dotnet/SqlClient/issues/609#issuecomment-645529802, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNJTDYMOC5HJSZP7HBLK6TRXD76HANCNFSM4OAQDQNQ.