locked
Display Connection String (or part of it) RRS feed

  • Question

  • Hi All

    I have a dev and production SQL server. I'm deploying my first Desktop LS app. In my release config, it connects to production SQL Server. In my debug config, it connects to dev SQL server. I'm looking for a way to indicate to the user, which environment they are connected to so that we don;t mess around in the wrong DB. Ideally, I'd like the DBname from the connection string to be displayed in the title bar (or some other clear indication about the environment)

    Any suggestions?

    Regards

    mark


    Mark

    Wednesday, March 19, 2014 5:50 PM

Answers

  • We implemented a simple RIA service to return environment settings as a custom dto. On the server you use all the same old libraries and code as in any .net app. settings, connectionstrings are just accessed with basic in-built support. There are definitely a couple of old forum posts with samples code. Try searching.

    > accessing-the-datasource-connection-string?forum=lightswitch


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.


    • Edited by Xpert360 Thursday, March 20, 2014 9:45 AM
    • Marked as answer by Angie Xu Friday, March 28, 2014 1:49 AM
    Wednesday, March 19, 2014 8:17 PM