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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Deplying a C# Application with Database Connection!

Deplying a C# Application with Database Connection!

Scheduled Pinned Locked Moved C#
csharpdatabasesysadminquestionsql-server
3 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
    dennis_max27
    wrote on last edited by
    #1

    I've a application running now with a database connection and wanna make a deployment of it I tried much things. So that's why I'm asking now is there a easy guide to follow where I can see what to do. My connection string is hard coded, after I deployed the application it's still hard coded what is the way to let the Data Source (Computer Name) change automaticly to the new computername where it is installed? (return @"Data Source=KONING-AF02EAF7\SQLEXPRESS;Initial Catalog=KringVrienden;Integrated Security=True";) SofwareI'm using: Visual Studio 2008. SQL Server 2005 SQL Management Server 2005 Please help me. Dennis,

    L V 2 Replies Last reply
    0
    • D dennis_max27

      I've a application running now with a database connection and wanna make a deployment of it I tried much things. So that's why I'm asking now is there a easy guide to follow where I can see what to do. My connection string is hard coded, after I deployed the application it's still hard coded what is the way to let the Data Source (Computer Name) change automaticly to the new computername where it is installed? (return @"Data Source=KONING-AF02EAF7\SQLEXPRESS;Initial Catalog=KringVrienden;Integrated Security=True";) SofwareI'm using: Visual Studio 2008. SQL Server 2005 SQL Management Server 2005 Please help me. Dennis,

      L Offline
      L Offline
      loyal ginger
      wrote on last edited by
      #2

      I am assuming that each of your target machine has a db server installed. In your program use System.Environment.MachineName to get the machine name. Use this instead of the hard-coded machine name in your connection string. Hope this helps.

      1 Reply Last reply
      0
      • D dennis_max27

        I've a application running now with a database connection and wanna make a deployment of it I tried much things. So that's why I'm asking now is there a easy guide to follow where I can see what to do. My connection string is hard coded, after I deployed the application it's still hard coded what is the way to let the Data Source (Computer Name) change automaticly to the new computername where it is installed? (return @"Data Source=KONING-AF02EAF7\SQLEXPRESS;Initial Catalog=KringVrienden;Integrated Security=True";) SofwareI'm using: Visual Studio 2008. SQL Server 2005 SQL Management Server 2005 Please help me. Dennis,

        V Offline
        V Offline
        vtchris peterson
        wrote on last edited by
        #3

        Rather than including your development machine name, simply use ".\SQLEXPRESS" or "(local)\SQLEXPRESS" as this will point to instance "SQLEXPRESS" on the local machine.

        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