要从附件.mdf进行远程连接 [英] To remote connect from the attach .mdf
问题描述
假设我的.mdf和.ldf文件存在于计算机(x)的指定位置中
我从本地计算机连接了.mdf文件并运行正常.
我的配置文件是:connectionString ="Server =.\ SQLEXPRESS; AttachDbFilename = | DataDirectory | \ SFD.mdf; Database = SFD; Trusted_Connection = yes; User Instance = True"
但是,当我从LAN Connection中的其他计算机执行项目设置后运行exe时,那么在这一刻,我将如何连接从其他计算机(y)指定的计算机(x)的.mdf文件?
请以任何正确的方式提供帮助.....
Suppose my .mdf & .ldf files are exist in specify location of computer(x)
i connect that .mdf file from local computer & fine works.
My config file is : connectionString="Server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SFD.mdf;Database=SFD;Trusted_Connection=yes;User Instance=True"
But when i run the exe after executing my project setup from other machine in LAN Connection, then at this momment how will i connect that .mdf file specified computer(x) from other computer(y)???
Please help any right way.....
推荐答案
更改您的web.config:
Change your web.config:
connectionString="Server=PCNAME\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SFD.mdf;Database=SFD;Trusted_Connection=yes;User Instance=True"
验证是否已在任何客户端PC中安装了SQL SERVER EXPRESS引擎.
希望对您有所帮助.
Verify that you have installed SQL SERVER EXPRESS engine in any client PC.
Hope it helps.
这篇关于要从附件.mdf进行远程连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!