I don’t know that this will solve the issue, as much as it will be a list of items to check. Possibly others can add more information.
Compare the SQL Driver being used in the code with the type you’ve selected in query analyzer and make sure it is the fastest driver available. (For example, if it’s a Oracle server you might actually want to use the Oricle driver rather than the standard Microsoft Oracle Driver since it is likely faster.
Check the code to ensure it is not doing something repetively (no matter how small) before, during, or after execution of the Stored Procedure.
Check for other processes running in SQL that are coincidently running when you run the code from visual studio.
Check for Locking conditions where one SQL call is actually blocking a table because of one call being made. This was very apparent in 2000 and before. Query analyzer would actually open teh whole table Read/Write if a select * was issued— and block other queries from occuring. (Bit me more than once with developers squaking about execution times on queries and another developer would have the table open in enterprise manager viewing data.)