PDA

Click to See Complete Forum and Search --> : General ASP.NET Question. Need comments pls


mpSmooth
Dec 4th, 2002, 09:26 AM
Hello, I'm very new to asp.net, so bare with me.
I'm developing a small site with about 5 total webforms. I'm using ado.net to connect with SQL Server. What is the best way to have all webfoms use the same connection object? Any thoughts, ideas, or anything to add would be greatly appreciated.

Thanks'

Cander
Dec 4th, 2002, 10:10 AM
you shouldnt do that. You dont want to keep a db connection open across pages. on each page open your db, you whatever actions you need to do with it, then close it immediatly

mpSmooth
Dec 4th, 2002, 01:32 PM
What if each page closed it after use and each new page request re-opened it. Also, what about the dataset reuse. Would you just pass it from page to page or store it somewhere globally??

rdove
Dec 4th, 2002, 02:13 PM
You could store the connection in a session object. You can also store datasets in a session as well.