连接字符串本地数据库中的错误与c# [英] error in connection string local database with c#

查看:91
本文介绍了连接字符串本地数据库中的错误与c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用vs2010创建了本地数据库并将其附加到新项目vs2010(Microsoft SQL Server Compact 3.5)



现在我收到连接字符串错误



i created local database with vs2010 and attached it with new project vs2010 as ( Microsoft SQL Server Compact 3.5)

now i get error with connection string

"Data Source=|DataDirectory|/Database.sdf"





建立与SQL的连接时发生网络相关或特定于实例的错误服务器。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:命名管道提供者,错误:40 - 无法打开与SQL Server的连接)





任何想法



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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


any idea

推荐答案

您好,



请尝试以下链接



https://www.connectionstrings.com/sql-server-compact/ [ ^ ]



我希望你能了解移动连接字符串以及上述错误的解决方案。



谢谢。
Hi,

Try this below link

https://www.connectionstrings.com/sql-server-compact/[^]

I hope you will get idea about mobile connection string as well as solution for above error.

Thank you.


你需要在连接字符串中提及用户名广告密码
You need to mentioned the username a d password as well in the connection string


这篇关于连接字符串本地数据库中的错误与c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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