I have install Sql Server Management Studio in my PC.
Then am connecting to one of my databases remotely
I execute a query that returns 6000 records in almost 1 or 2 seconds but when i run the same query from .Net Application (WPF Desktop) also from the same PC the data transfer takes almost 8-9 seconds
My Code in .Net is very simple and straightforward
This is the code
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Dim Sql_Connection As New SqlClient.SqlConnection("MyRemoteSQLConnectionString")
Dim Sql_Command As New SqlClient.SqlCommand("select Col1,Col2,Col3,Col4,Col5,Col6 from Table", Sql_Connection)
Sql_Connection.Open()
dr = Sql_Command.ExecuteReader
Dim DataTable As New DataTable
DataTable.Load(dr)
'The above code takes 8-9 seconds to finished but in ssmo takes only 1-2 seconds for 6000 Records
Sql_Connection.Close()
End Sub
why this happens? dose ssms has different way to manage the data transferred ?
OK, seems i found the answer in this POST
Same query with the same query plan takes ~10x longer when executed from ADO.NET vs. SMSS
MultipleActiveResultsSet option in ado.net ConnectionString should be FALSE
and @DanGuzman thank you for clearing this. "SSMS also uses ADO.NET."