Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法打开数据库,因为它是版本904。此服务器支持版本852和更早版本。不支持降级路径_C#_Sql Server_Visual Studio_Visual Studio 2010 - Fatal编程技术网

C# 无法打开数据库,因为它是版本904。此服务器支持版本852和更早版本。不支持降级路径

C# 无法打开数据库,因为它是版本904。此服务器支持版本852和更早版本。不支持降级路径,c#,sql-server,visual-studio,visual-studio-2010,C#,Sql Server,Visual Studio,Visual Studio 2010,该文件是使用SQL Server 2019版本(localdb或full)创建的。 您机器上安装的localdb支持SQL Server 2016文件。 因此,您无法打开该文件 您有两个选择: 将您的localdb版本升级到2019版 尝试获取与您的版本兼容的文件 以下是SQL Server文件版本的列表: SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB

该文件是使用SQL Server 2019版本(localdb或full)创建的。
您机器上安装的localdb支持SQL Server 2016文件。
因此,您无法打开该文件

您有两个选择:

  • 将您的localdb版本升级到2019版
  • 尝试获取与您的版本兼容的文件
  • 以下是SQL Server文件版本的列表:

        SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB
                                           ;AttachDbFilename=D:\xxxx\xxxx\xxxxx.mdf
                                           ;Integrated Security=True");
        con.Open();