performance with ADO.Net and stored proc issue

Hi

Im trying to call a stored procedure to populate a datareader. Now in query analyser (SQL 2000) the stored proc takes 4 seconds to run.

In my VB.Net app however its taking close to 30 seconds. Now i know theres going to be a bit of a delay as query analyser is sat on the database and VB isnt. But the thing is, if i execute the stored proc using classic ADO to populate a dataset it still takes exactly the same time as the ADO.Net code.

Now i thought ADO.Net would be a lot quicker than ADO here? Am i missing something? The code im using is.....

Dim commandAs SqlCommand

Dim objDRAs SqlClient.SqlDataReader

Dim strConnAsString ="xxxxx"

command =New SqlClient.SqlCommand("spGetTasks",New SqlClient.SqlConnection(strConn))

command.CommandType = CommandType.StoredProcedure

Dim claimrefParamAs SqlParameter = command.Parameters.Add("@ClaimRef", SqlDbType.VarChar)

claimrefParam.Direction = ParameterDirection.Input

claimrefParam.Value = strCurrentRef

command.Connection.Open()

objDR = command.ExecuteReader

What would be the fastest way i can get a result set from SQL by executing a stored proc?

Thanks for any help in advance :)

[2092 byte] By [AshleyC-UK] at [2007-12-24]
# 1

something IS wrong there, the code to me looks fine - something wrong somewhere. What other multiple things are you, if any, doing in the SPROC? (Stored Procedure)

For me, to get say 10000 records takes me (using a SPROC: SELECT * FROM table) about 8-14 seconds (network traffic depends also) - thats just a rough estimate but it doesnt take as long as you are stating.

Where is the SQL Server based?

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...