Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    42

    Unanswered: database connection

    VS2005
    i just wonder how can i avoid repeating my connection string. in every form load and control event, i create connection. is there a way that i will only create once and just call it? i tried using method but it didn't work. it's looking for the connection string.. or maybe I'm doing it incorrectly. pls help!

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    most people put it in web.config. Then each of your pages that needs it can just load it from there.

    even better is to ENCRYPT it in web.config.

  3. #3
    Join Date
    Feb 2007
    Posts
    42
    I'm just creating a windows application.. so is it web.config? I'm just wondering the word web. just asking... tnx!

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    in that case it would be app.config.

Posting Permissions

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