I use the sample code in a vb.net web app. It takes 6-10 seconds to return data from SQL server. If I do the same query in query analyzer the results come back in 15 milleseconds.
I have tried this query in .Net using the four combos of .Net 1.1 and 2.0 and SQL Server 2000 and 2005. I makes no diff. I have heard that this is a .net issue, and an hoping somebody know a workaround for it.
Here is my sample code.
Dim conn As New SqlConnection("workstation id=PAMS-PAT2;packet size=4096;user id=sa;data source=PAMS-WEB3;persist security info=True;initial catalog=Interchange;password=xxxxx")
Dim intYearID As Integer = CInt(Request.Form("YearId"))
Dim dsModel As New DataSet
Dim cmd As SqlCommand = New SqlCommand("Exec getManu " + intYearID.ToString, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Thanks in advance.