How do I connect to an older sql database using LocalDb in VS 2012?

ATL_DEV picture ATL_DEV · Mar 14, 2013 · Viewed 26.8k times · Source

I am trying to construct a connection string to a 2008 SQL Express database file in VS 2012. I am getting an error dialog:

This database file is not compatible with the current instance of SQL Server. To resolve this issue, you must upgrade the database file by creating a new data connection, or you must modify the existing connection to this database file. For more information, see http://go.microsoft.com/fwlink/?LinkId=235986

I followed the link to Microsoft's always wonderfully helpful documentation (cough, cough..). When I went through the upgrade database function, I was not presented with a prompt to upgrade the file. I was really hoping to use LocalDb instead of having to do a install of SQL Express 2008. Any thoughts?

OTHER: Why hasn't Visual Studio implemented clicking on links in the error dialogs after all these years? Is it really hard to implement?

Answer

OmiD picture OmiD · Jun 27, 2014

my simple way:

  1. go to VisualStadio 2012
  2. In Server Explorer Windows
  3. open Data Connections
  4. Right click on ASPNETDB.MDF
  5. click on Modify Connection...
  6. a new windows open for you ... you just click OK
  7. if other windows open for you click Yes
  8. FINISH ( be Happy ) :D