SQLDataSource Connections Not Closing Maxing out Connection Pool on SQL Server

I have been using the SQLDatasource object througout this project and believe it is the source of my connections maxing out.   It seems the SQLDatasource object does not automatically disconnect the connection.  I use several SQLDatasources on various pages and I believe this is the source of my problem.   My questions is how do you manually code this to force the SQLDatasource connection to close?     I am thinking it might be best to stay away from this object, even though it is a very useful tool, but I am thinking it may not be the best solution for larger scale projects.    Any feedback on this topic would be greatly appreciated.
jholmes0724Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

Have you tried doing,

Conn.Close()
Conn.Dispose()
0
Alfred A.Commented:
Hi,

Additional comment, be sure to close all objects using the sqldatasource before doing a dispose.
0
Alfred A.Commented:
Hi,

Just an example by the way, if you have a data reader using a SQLDataSource, you need to close the data reader first before doing a dispose.

For example,

DR.Close()
.....

SQLDataSource1.Dispose()
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

jholmes0724Author Commented:
I don't think just disposing the SQLDatasource closes the connection.   The whole point of the SQLDatasource is that it contains the connection, datareader, and sql in one container.  Its not like when you use the SQL.Data.SQLClient objects and define those on your own.  So your answer seems to be more about using those objects.   I am refering to the SQLDataSource object.  Do you understand what I mean?
0
Alfred A.Commented:
Hi,

Yes, I understand what you meant.  So what I meant awhile ago is for you to deal whatever that refers to the SQLDataSource and then dispose SQLDataSource.

Check this out, it might help:

http://forums.asp.net/p/1275516/2436239.aspx#2436239
0
Alfred A.Commented:
Hi,

Also, here is another one that discuss about SQLDataSource Dispose within EE.

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_25136140.html

I hope you understand now what I was trying to convey awhile ago.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jholmes0724Author Commented:
Thanks, This does seem to work.  Thanks so much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.