Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. ? SET PASSWORD THROUGH CODE in Connectionstring

? SET PASSWORD THROUGH CODE in Connectionstring

Scheduled Pinned Locked Moved Windows Forms
questiontutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kutbi Naharpura
    wrote on last edited by
    #1

    hii i want know that when we add any data source to the project it has two options 1. No, exclude sensitive data from the connection string, i will add in my application code 2. Yes, include sensitive data in my connection string 2nd option is nuthing anyone can use it but how to use the first option ??? how to add sensitive data in application code ??? how can i do that please provide any easy way as i didnt find it thanks with regards k

    S 1 Reply Last reply
    0
    • K Kutbi Naharpura

      hii i want know that when we add any data source to the project it has two options 1. No, exclude sensitive data from the connection string, i will add in my application code 2. Yes, include sensitive data in my connection string 2nd option is nuthing anyone can use it but how to use the first option ??? how to add sensitive data in application code ??? how can i do that please provide any easy way as i didnt find it thanks with regards k

      S Offline
      S Offline
      Sk93
      wrote on last edited by
      #2

      1: have a look at the SqlConnectionStringBuilder class, as this will give you the ability to change the password within a connection string: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx[^] Using this class, you can store the full connection string, with a dummy password in the app.confg file. Then, when you want to use it in code, you can use the SqlConnectStringBuilder class to alter the string so that it includes the correct password. 2: Have a look at this article, as I believe it does exactly what you want: Encrypt and Decrypt ConnectionString in app.config and/or web.config![^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups