Query Taking LONG time with DataAdapter.Fill

I have a SPROC, nothing to crazy...few sums and 2 joins.

In query analyzer, it takes .0 seconds to run. From code, right on DataAdapter.Fill(myTable). 20 seconds or times out.

Not sure what to do from here aside from the obvious which I have checked (indexes, etc).

Thanks for help.
Who is Participating?
bluedevil9Connect With a Mentor Commented:
remove the unnecessary dependencies before executing the query.
let me know if the comment was helpful
melegant99Author Commented:
How can i check what is an 'unnecessary ' dependency?
qasim_mdConnect With a Mentor Commented:
Put select ... from table1 (nolock) in your queries and try...
melegant99Author Commented:
Great thanks, that did help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.