Can I use connection pooling with SQLDatasource?

霸气de小男生 提交于 2019-12-13 03:47:49

问题


After reading documentation about Connection Pooling, I learned that ADO.NET uses Connection pooling by default. But the application that I am working with using SQLDatasource and I wonder if I can use Connection Pooling?

If yes, is there a quick tutorial around?


回答1:


My guess would be that it uses System.Data.SqlClient in turn so that as long as you use the same connection string, pooling will work.

I think you can test it quite easily though. Just spawn up a bunch of these from code and attach the sql profiler and see if you get alot of calls to "sp_reset_connection" which gets called every time a connection is pulled from the pool.



来源:https://stackoverflow.com/questions/6928412/can-i-use-connection-pooling-with-sqldatasource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!