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. C#
  4. Changing connection string in app.config file at runtime.

Changing connection string in app.config file at runtime.

Scheduled Pinned Locked Moved C#
csharpdatabaselinqsysadminhelp
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.
  • S Offline
    S Offline
    Sanket Patil
    wrote on last edited by
    #1

    Hi, I need your help for my project. I am new to use Linq To Sql. I have .DBML File and it automatically takes the connection string From SETTING.DESIGNER.CS File or From APP.CONFIG File by changing Application Property of .dbml file to False. But I Want to Provide Connection String at runtime. Because as it is desktop application developed in C# so before installing EXE at client side we are unknown of the server on which the database is attached. The only one solution I have is I have to reopen my application, set the connection string as per user and again make its EXE, this is what i dont want. Can I pass the connection string at runtime to .dbml file when i run my exe or can i change my app.config connection string at runtime.

    .

    M 1 Reply Last reply
    0
    • S Sanket Patil

      Hi, I need your help for my project. I am new to use Linq To Sql. I have .DBML File and it automatically takes the connection string From SETTING.DESIGNER.CS File or From APP.CONFIG File by changing Application Property of .dbml file to False. But I Want to Provide Connection String at runtime. Because as it is desktop application developed in C# so before installing EXE at client side we are unknown of the server on which the database is attached. The only one solution I have is I have to reopen my application, set the connection string as per user and again make its EXE, this is what i dont want. Can I pass the connection string at runtime to .dbml file when i run my exe or can i change my app.config connection string at runtime.

      .

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

      Second time you post the same question. Was there a problem with the soltution[^] that Henry Minute provided?

      Excellence is doing ordinary things extraordinarily well.

      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