I have a dataset in a Visual Studio 2010 Web App project which accesses the DB with a complex SQL statement. If I run the statement in SQL Management Studio directly, it loads in a less than a second. If however, I run it using the “Preview Data” button in the dataset designer, or I try to access it on a page (with a gridview for example), it takes over 40 seconds!
What steps should I take to track down what’s causing this huge delay when working with the dataset?
There are two cases:
SQLquery itselfSo as first step try to exclude one of the cases, much easier from my perspectives is to debug
SQLside:Sql Profilerfrom Management StudioSQL