Re: Best Practices for using SqlConnection

Discussion in 'ASP .Net' started by Natty Gur, Aug 26, 2003.

  1. Natty Gur

    Natty Gur Guest

    Hi,

    It’s better to keep the connection string in one place but not
    SqlConnection (object). SqlConnection should be open and close just
    after you finish your work against DB. Its bad practice to use one
    connection, open it when application starts, and use it for every
    request.

    The best practice is not to deal with DB in the pages at all! Create
    dedicate DLL that will handle all the DB access stuff and will be called
    from your pages. This layer approach will help you maintain easily your
    application.

    If you are going to adopt this layer approach and separate Data from
    visualization keep in mind that DtataSets break this model (and harm
    performance) since they hold DB definitions. Consider use one of the ORM
    tools instead.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Aug 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karim
    Replies:
    0
    Views:
    444
    karim
    Jul 13, 2003
  2. Krissy
    Replies:
    2
    Views:
    4,833
  3. mid
    Replies:
    4
    Views:
    7,266
    Scott Allen
    Dec 14, 2004
  4. John Dalberg
    Replies:
    3
    Views:
    560
    samuelhon
    Nov 16, 2006
  5. Chicken McNuggets

    Best book on C gotchas and best practices?

    Chicken McNuggets, Jul 31, 2013, in forum: C Programming
    Replies:
    9
    Views:
    255
    Fred J. Tydeman
    Aug 5, 2013
Loading...

Share This Page