NovelProjects

Monday, December 14, 2009

SqlDataAdapter.Fill method running slow

I ran into an issue today where I was using the SqlDataAdapter.Fill method and it was taking an unusually long time to return back. I ran the query in Management Studio and it was fast, as I expected. After a little googling I ran across this post where it was mentioned to run:


DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

This clears out the memory buffers and procedure cache.


After doing that my SqlDataAdapter.Fill method ran much faster!