I\'ve query executing ~2 secs in MSSMS (returning 25K of rows)
Same query used in .NET (sqlReader) exetuting few minutes!
I\'ve also tried to execute only re
I would check to see how long the actual retrieval is taking.
for instance:
Private Sub timeCheck()
'NOTE: Assuming you have a sqlconnection object named conn
'Create stopwatch
Dim sw As New System.Diagnostics.Stopwatch
'Setup query
Dim com As New SqlClient.SqlCommand("QUERY GOES HERE", conn)
sw.Start()
'Run query
Dim dr As SqlClient.SqlDataReader = com.ExecuteReader()
sw.Stop()
'Check the time
Dim sql_query_time As String = CStr((sw.ElapsedMilliseconds / 1000)) & " seconds"
End Sub
This will allow you to see whether the hold-up is in the retrieval, or in the execution of the reader.