I have a problem with my connection to SQL Server in a C# application.
After Open()
, I see a NetBios request, but the server does not respond and after a few seconds, the connection is closed:
https://photos.app.goo.gl/mut3srWNxKXRUYDcA
After 2-3 attempts, the connection is established, but it takes around 10 seconds.
On the client side, we don’t use SQL NetBios but instead pipe connection type only - something like that (with Windows authentications):
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = “SERVER=1.2.3.4;DATABASE=dbName;POOLING=true;Connect Timeout=30;Integrated Security=SSPI”;
conn.Open();
SqlCommand command = new SqlCommand("SELECT [ColumnName] FROM TableName", conn);
SqlDataAdapter da = new SqlDataAdapter(command);
da.Fill(dt);
conn.Close();
da.Dispose();
}
How to enable respond for this NBSTAT packets on server side or disable it on application side in C# code (but not disabled NetBios itself).