Search code examples
c#asp.netsql-server-2008-r2sql-server-2008r2-express

Getting an error when moving from SQL Server Express to SQL Server asp.net web app logon


I just moved from Visual Studio Web Express to professional. (2010)

I have a web application were the log-on database was linked to SQL Server Express, but my new installation does not have SQL Server Express? What I have now is SQL Server 2008 R2.

I'm now getting this error trying to log-on to the website :

ASPNETDB.MDF cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.

I see in my web.config there is a connections to SQL Server Express.

<add name="ApplicationServices" 
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />

I'm pretty sure here lies my problem, I'm just not sure how I can go about fixing this. Can I import this data into SQL Server 2008 R2 and then re-point the connections string to that?

any help would be great.


Solution

  • The problem is that you are trying to open an older version of the database file in a newer version of SQL Server. You should attach the database to the SQL Server instance using the SQL Server Management Studio, which will upgrade the database to the correct version.