Results 1 to 4 of 4

Thread: General ASP.NET Question. Need comments pls

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217

    General ASP.NET Question. Need comments pls

    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'

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    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??

  4. #4
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    You could store the connection in a session object. You can also store datasets in a session as well.
    ~Ryan





    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width