问题描述
我正在使用 Visual Studio 2017 和 SQL Server 2014.在将数据库文件附加到 Visual Studio 时,我收到此错误:
I am using Visual Studio 2017 and SQL Server 2014. While attaching a database file to Visual Studio, I get this error:
""
升级文件后我使用了这个连接字符串
After upgrading the file I used this connection string
<connectionStrings>
<add name="con"
connectionString="Data Source=(LocalDB)MSSQLLocalDB;AttachDbFilename=|DataDirectory|inaaelmamorra.mdf;Integrated Security=True;Connect Timeout=30"/>
</connectionStrings>
它在我的机器上运行良好,但在客户端机器上,弹出一个错误提示
It's working fine on my machine, but on the client machine, an error pops up saying
无法打开,因为是852版本.本服务器支持782及更早的版本
Cannot be opened because it is version 852. This server supports version 782 and earlier
虽然我在客户端安装了 SQL Server 2016 本地数据库,但我仍然无法摆脱它.
Though I installed SQL Server 2016 local DB on the client side, I still can't get rid of it.
我的第二个问题是:数据库文件不兼容的SQL Server当前实例是什么?
My second question is: what is the current instance of SQL Server to which the database file is not compatible?
推荐答案
这对我有用:
打开命令提示符并输入:
open command prompt and type :
cd "C:Program FilesMicrosoft SQL Server130LocalDBBinn"
在cmd中运行此命令删除本地数据库:
Run this command in cmd to delete the local db :
SqlLocalDB.exe delete "MSSQLLocalDB"
(或 SqlLocalDB.exe 停止MSSQLLocalDB"
,如果您收到实例仍在运行的错误)
(or SqlLocalDB.exe stop "MSSQLLocalDB"
, if you get an error of intance still running)
然后输入此命令以创建本地数据库的新更新实例:
Then type in this command to create a new updated instance of local db :
SqlLocalDB.exe create "MSSQLLocalDB"
参考:https://www.youtube.com/watch?v=bCjc9Mmx-bM
这篇关于852版本打不开.本服务器支持782及更早版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!