如何连接到LocalDb [英] How to connect to LocalDb

查看:192
本文介绍了如何连接到LocalDb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SqlLocalDb.msi软件包安装了LocalDb,并且可以使用服务器名称(LocalDb)\v11.0使用SSMS连接到它.到目前为止,一切都很好.问题是,当我尝试通过.NET 4.5应用程序连接到它时,出现错误

I installed LocalDb using the SqlLocalDb.msi package and I can connect to it using SSMS using the server name (LocalDb)\v11.0. So far so good. The problem is that when I try to connect to it via a .NET 4.5 application I get the error

找不到服务器或无法访问服务器.

The server was not found or was not accessible.

我从连接字符串Data Source=(LocalDb)\v11.0开始,然后添加了许多内容,但无济于事(集成安全性true/sspi,附加数据库,使用实例等)

I started with the connection string Data Source=(LocalDb)\v11.0 and then added many things to no avail (integrated security true/sspi, attaching a db, using instances, etc.)

推荐答案

我认为您遇到的问题与

I think you hit the same issue as discussed in this post. You forgot to escape your \ character.

这篇关于如何连接到LocalDb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆