locked
How do you change the DEVELOPMENT/DEBUG connection string of a VS13 Lightswitch project? RRS feed

  • Question

  • I recently had a PC swap and had to move everything to a new PC - including the SQL Database used for Visual Studio Lightswitch development and the VS13 project itself.

    How do I change the connection string so the VS project is no longer pointing to the old PC (which is no longer on the network)?

    Friday, October 24, 2014 5:44 PM

Answers

  • Which of the following is what you need to change?

    1) An external data source you are connected to during development (i.e. NOT the ApplicationData/intrinsic data source)

    2) The connection string for a LightSwitch project that has been published

    This is the main point that needs clarification:

    "including the SQL Database used for Visual Studio Lightswitch development"

    I am assuming that this means a database that is being attached as an external data source, because the connection string for the ApplicationData/intrinsic data source wouldn't change if you moved machines (since it would be LocalDB)


    David Kidder | Senior SDET | Microsoft | LightSwitch

    • Marked as answer by Angie Xu Tuesday, November 4, 2014 7:51 AM
    Monday, October 27, 2014 12:08 AM
    Moderator

All replies

  • Look in the Server project's web.config. Settings are in the <connectionStrings> section.

    Paul

    Friday, October 24, 2014 5:49 PM
  • Also (i think with the March update), you can now do it on your Server's DataService:

    Namespace LightSwitchApplication
        Public Class ApplicationDataService
          Private Sub ApplicationData_InitializingConnection(state As DatabaseConnectionState)
                 state.ConnectionString = "Data Source=;Initial Catalog=;User ID=;Password="
            End Sub
        End Class
    
    End Namespace

    Friday, October 24, 2014 6:48 PM
  • Which of the following is what you need to change?

    1) An external data source you are connected to during development (i.e. NOT the ApplicationData/intrinsic data source)

    2) The connection string for a LightSwitch project that has been published

    This is the main point that needs clarification:

    "including the SQL Database used for Visual Studio Lightswitch development"

    I am assuming that this means a database that is being attached as an external data source, because the connection string for the ApplicationData/intrinsic data source wouldn't change if you moved machines (since it would be LocalDB)


    David Kidder | Senior SDET | Microsoft | LightSwitch

    • Marked as answer by Angie Xu Tuesday, November 4, 2014 7:51 AM
    Monday, October 27, 2014 12:08 AM
    Moderator