c# – 无法从文件连接到数据库

前端之家收集整理的这篇文章主要介绍了c# – 无法从文件连接到数据库前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试连接:Microsoft sql Server数据库文件(sqlClient),但我收到错误

The attempt to attach to the database Failed with the following
information: A network-related or instance-specific error occurred
while establishing a connection to sql Server. The server was not
found or was not accessible. Verify that the instance name is correct
and that sql Server is configured to allow remote connections.
(provider: sql Network Interfaces,error: 52 – Unable to locate a
Local Database Runtime installation. Verify that sql Server Express is
properly installed and that the Local Database Runtime feature is
enabled.)

所以,我在服务器资源管理器中单击连接到数据库

这个窗口出现了.在其中我选择:Microsoft sql Server数据库文件(sqlClient),然后浏览我的.mdf数据库文件.

点击ok会提供前面提到的错误

服务器正在运行,我在数据库中使用Windows身份验证.
任何食物?

解决方法

您需要sql Server Express LocalDB加载项,您可以从 here在x86& amd64版本.

猜你在找的C#相关文章