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. Web Development
  3. ASP.NET
  4. how to save connection string in web.config programmatically

how to save connection string in web.config programmatically

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorialquestion
4 Posts 3 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.
  • D Offline
    D Offline
    dream_liner_7e7
    wrote on last edited by
    #1

    i m accepting users remote server ip, id, pwd, now i have to make a connection string and save it in web.config. how to save connection string in web.config programmatically? Thanks in advance.

    M J 2 Replies Last reply
    0
    • D dream_liner_7e7

      i m accepting users remote server ip, id, pwd, now i have to make a connection string and save it in web.config. how to save connection string in web.config programmatically? Thanks in advance.

      M Offline
      M Offline
      meeram395
      wrote on last edited by
      #2

      Go through this site. You can add and encrypt the connection strings: Encrypting Connection Strings

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      D 1 Reply Last reply
      0
      • D dream_liner_7e7

        i m accepting users remote server ip, id, pwd, now i have to make a connection string and save it in web.config. how to save connection string in web.config programmatically? Thanks in advance.

        J Offline
        J Offline
        John Gathogo
        wrote on last edited by
        #3

        The ConfigurationManager class has functionality that would allow you to load the configuration file, target the section that has the connection string (typically, ConnectionStrings or AppSettings), modify the connectionstring and then save back. You will need to import System.Configuration namespace.

        1 Reply Last reply
        0
        • M meeram395

          Go through this site. You can add and encrypt the connection strings: Encrypting Connection Strings

          Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

          D Offline
          D Offline
          dream_liner_7e7
          wrote on last edited by
          #4

          Thanks for the solution it worked fi9

          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