When Microsoft first released LightSwitch I first heard about LightSwitch about a year ago (or so), I made a Contact Manager app from it and published it and sent it to a friend and it worked “out of the box” so to speak, in the sense that I didn’t need to connect it to a “database” as it was just using its own in-built database (I’m assuming – since no data source/database was ever specified).
I’ve since returned to LightSwitch dev and have noticed that this is no longer possible. This is a huge downside for me, but oh well.
Is there still a way to use it without importing your own, or connecting to an external datasource? Or, if that is no longer possible, how can we make LightSwitch populate all relevant Tables, columns, etc in a new, blank Database file (MDF)?
You don’t need to “connect to an external database“, but the intrinsic database (the one that LightSwitch creates when you add tables to any application) still has to be attached to an instance of SQL Server (even SQL Server Express) when it’s published. A non published application will only run if LightSwitch has been installed on the “other” machine as well.
The only time a LightSwitch application will run without specifying a connection string to a SQL Server instance is when it’s being developed. For debugging, LightSwitch attaches a “user instance” to the instance of SQL Server Express 2008 that it installs during the installation of LightSwitch itself. It’s never been any other way. LS 2011 has always needed SQL Server Express 2008 for development, & a connection string pointing to a valid installed instance of SQL Server 2005 (or above).
If you’re talking about LS 2012 (VS 2012), then it still needs a SQL instance to connect to for any published application, but for debugging, it now uses a new feature of SQL Server Express 2012, called LocalDB.