SQLCommand calls sp_executesql implicitly
- From: "Aamir Mahmood" <aamirmahmood@xxxxxxxxx>
- Date: Wed, 4 Feb 2009 15:12:39 -0800
Hi,
I am using SQLCommand object to create datasets and open data readers.
I found that on various occassions the same query if I run in Management
Studio runs instantaneously, but within code that query takes too long to
execute.
To investigate I started looking at the SQL Server Profiler, I found a weird
issue.
All my queries that I run through SQLCommand are converted into
"sp_executesql" call.
Why is this happening, and how can I avoid it.
When I run same queries from Management Studio, the profiler shows query
being run without the wrapper of sp_executesql.
Please help.
Thanks.
AM.
.
- Follow-Ups:
- Re: SQLCommand calls sp_executesql implicitly
- From: Frans Bouma [C# MVP]
- Re: SQLCommand calls sp_executesql implicitly
- Prev by Date: How to add a property to a Table Adapter that can be bound to?
- Next by Date: Re: most puzzle question 1 about sqlparameters.My question is following the ///.thank you.
- Previous by thread: How to add a property to a Table Adapter that can be bound to?
- Next by thread: Re: SQLCommand calls sp_executesql implicitly
- Index(es):
Relevant Pages
|