How will I handle it if different instances of SQL Express are on different machines.

  • I'm getting ready to start work on a re-writing one of our major applications. The old app is written in VB6 (actually, it started life in VB5), and the new app will be a WPF app. The database I've decided to use for this app is SQL Server 2008 Express R2. We'll install it on all of our users machines, as well as laptops that go off site for several months at a time. Anyway, in helping my co-workers to setup their development systems with SQL Express, I've noticed that not everyone can install SQL Express 2008 R2 as the default instance. This causes me a lot of concern, because the new app should have only 1 connection string. I'm used to writing apps with only 1 connection string, normally put into some configuration file, etc.

    Anyway, is there a way I can get around the fact that different machines may have different instances of SQL Express installed, and that I may have to specify different connection strings in the configuration files? I would like to have a turnkey solution that one could easily install, but am afraid that setting up the finished app on users machines may require more hand editing than I care for. How can I get around this?

    Rod

  • Put the connection string in the app.config then you can change the connection string as needed using a text editor. In your code make sure to call the connection string from the app.config file instead of hard coding it.

  • Thank you, Neal.

    Kindest Regards, Rod Connect with me on LinkedIn.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply