locked
SQL Server DB Connection Problems RRS feed

  • Question

  • I bought a new computer and installed SQL Server Express 2014 and Visual Studio Express 2013. I've been able to connect to attach the database I created in SQL Server Express 2012 in SQL Server Express 2014 and view and edit tables.

    When I try to work with my web site in Visual Studio Express 2013, I've been having a variety of problems.  Most recently, the error message is:

    "An exception of type 'System.Data.SqlClient.SqlException' occurred in App_Web_c0sv1x2m.dll but was not handled in user code

    Additional information: Unable to open the physical file "C:\Safety_Designs\App_Data\SafetyDesigns.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".

    An attempt to attach an auto-named database for file C:\Safety_Designs\App_Data\SafetyDesigns.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

    That's the error message I get when I use the Connection String "Data Source=(LocalDB)/v11.0"

    When I change the Connection string to v12.0 (this was suggested somewhere else), I get a different error:

    "The database 'DB Path' cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported." along with the above error.

    I don't understand what the problem is. The file is there and it's not being used by any other process that I can see. There's no other DB with the same name.

    Any help is greatly appreciated.  Thanks.



    • Edited by MavilaJay Sunday, January 25, 2015 7:33 PM
    Sunday, January 25, 2015 6:19 PM

Answers

  • Hi MavilaJay,

    From your description, you have attached the database in SQL Server 2014 Express and want to connect to the database from Visual Studio 2013, right?

    If that is the case, assume that the local SQL Server Express instance is named SQLEXPRESS, which is the default, please use the Connection String " Data Source=.\SQLEXPRESS" to connect to SQL Server 2014 Express. For more details about SQL Server Express connection sting, please review this similar article: https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx .

    "The database 'DB Path' cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported."
    Besides, according to above error message, version 782 means SQL Server 2014 and version 706 means SQL Server 2012. If you are trying to attach the database created on a SQL Server 2014 into a SQL Server 2012. That is called a downgrade and it is not supported. Here is a similar blog for your reference.


    Thanks,
    Lydia Zhang


    Lydia Zhang
    TechNet Community Support





    Monday, January 26, 2015 8:49 AM