到本地数据库文件的连接字符串不起作用
connectionString="AttachDbFilename=C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF;Integrated Security=True; User Instance=True"
providerName="System.Data.SqlClient" />
这是服务器资源管理器为我的本地 MDF 文件提供的连接字符串。 尝试运行该应用程序时,我不断收到以下错误。
"Format of the initialization string does not conform to specification starting at index 25."
有谁知道这是什么吗?
谢谢!
connectionString="AttachDbFilename=C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF;Integrated Security=True; User Instance=True"
providerName="System.Data.SqlClient" />
This is the connection string that is provided to me from the Server Explorer for my local MDF file. I keep receiving the following error when attempting to run the application.
"Format of the initialization string does not conform to specification starting at index 25."
Anyone know what this is?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
非常感谢大家。 我的问题实际上是我提供 NHibernate 配置的连接字符串。 看来本地数据文件路径不应该用 's 或 "s 括起来。感谢您的回复。
Thanks a lot everyone. My problem was actually with the connection string I was providing NHibernate configuration. It would appear that the local data file path should not be wrapped in 's or "s. Thanks for the replies.
我想说的是文件名中的空格。 尝试将其括在 '' 中,例如
或将其复制到 c:\ 进行测试
I'd say it is the spaces in file name. Try enclosing it in '' e.g.
or copy it to c:\ for a test
尝试替换:Integrated Security=True
为:Trusted_Connection=Yes
Try replacing: Integrated Security=True
With: Trusted_Connection=Yes
您是否尝试过在反斜杠上使用转义字符?
变成
Have you tried using escape characters on the backslashes?
becomes