Help with database in CSLA MVC sample project

Help with database in CSLA MVC sample project

Old forum URL: forums.lhotka.net/forums/t/11729.aspx


Aravinda posted on Wednesday, November 28, 2012

Hi,
   I have downloaded project trackaer sample application(CSLA MV sample proect). Earlier, I had it installed on Windows 7 home premium machine(32 bit) with SQL Server 2008 express edition.
I could not attach/open ptracker.mdf(I was getting the error shown below). So, I installed SQL Server 2008 R2 Express. Then I was able to attach/open ptracker.mdf database. Now I have changed my machine to Windows 7 64 bit professional.
Now, no matter which SQL Server edition I install, I am getting the same old error. See the details below. I have also included SQL server version details which I got from Help-->About menu.
Please help.

Thanks,
-Aravinda

 

ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The database 'C:\VISUAL STUDIO PROJECTS\CSLA\40\SAMPLES\NET\CS\PROJECTTRACKER\WCFAPPSERVER\APP_DATA\PTRACKER.MDF' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.
Could not open new database 'C:\VISUAL STUDIO PROJECTS\CSLA\40\SAMPLES\NET\CS\PROJECTTRACKER\WCFAPPSERVER\APP_DATA\PTRACKER.MDF'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)
 
Sql Server version
Microsoft SQL Server Management Studio  10.50.4000.0
Microsoft Data Access Components (MDAC)  6.1.7601.17514
Microsoft MSXML     3.0 4.0 6.0
Microsoft Internet Explorer   9.0.8112.16421
Microsoft .NET Framework   2.0.50727.5466
Operating System    6.1.7601

JonnyBee replied on Wednesday, November 28, 2012

Version 661 is SqlServer 2008 R2 and 655 is SqlServer 2008.

You may have more than one instance of SqlServer Express on your computer. Please make sure to use the R2 instance.Or if you did an update the SqlServer express may not have been updated correctly.

Another option is to download an older version of the PTracker samples databases and replace the ones in your sample folder.

Aravinda replied on Wednesday, November 28, 2012

Jonny,

 Thank you for your reply. I did further investigation to check if there areany other versions of SQL Server in my machine while I had uninstalled SQL Server 2008. I found some registry entries and there was no SQl Server installed. I followed the following steps

1. Uninstalled SQl Server
2. Removed nodes for SQL Server registry entries (I think 3 of them SQLExpress, MSSQLServer.. )
3. Reinstalled SQL Server 2008 R2 Express with SP2
4. I could now attach the data base from SQl Server. But could not connect via Visual Studio 2010. I got the following error:

Failed to generate a user instance of sql server due to failure in starting the process for the user instance. The connection will be closed.

5. I followed instructions from this site to delete content from %localAppData% folder
6. Eevrything worked fine after restarting the machine

 

tiago replied on Thursday, November 29, 2012

Hi Aravinda,

Aravinda
Failed to generate a user instance of sql server due to failure in starting the process for the user instance. The connection will be closed.

http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/88def9dd-5bf7-4156-b416-6db1c6752d48/

1) Open SQL Management Studio
2) On a new query editor window type exec sp_configure 'user instances enabled', 1.
3) Then type: Reconfigure.
4) Then restart the SQL Server database.

Copyright (c) Marimer LLC