到远程连接以附加.mdf [英] To remote connection to attaching .mdf

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

问题描述

我通过配置文件&很好.
我的配置文件是:->
-------------------

I connect my local computer(A) through the config file & it is fine works.
My config file is :->
-------------------

<configuration>
  <configsections>
  </configsections>
  <connectionstrings>
    <add name="AttachmentDBConnection.My.MySettings.DatabaseConnectionString"  ConnectionString="Server=.\SQLEXPRESS;AttachDbFilename=D:\AttachmentDBConnection\AttachDBFile\Atta2005.mdf;Database=Atta;Trusted_Connection=yes;User Instance=True"

      providerName="System.Data.SqlClient" />
    </connectionstrings>
</configuration>


我的.mdf文件位于D:\ AttachmentDBConnection \ AttachDBFile

我也共享应用程序Folder.
我将如何通过.config文件连接来自其他计算机(B)的该定位.mdf文件??

请以任何方式帮助我.....


My .mdf file is located in D:\AttachmentDBConnection\AttachDBFile

I also share the application Folder.
How will i connect that locating .mdf file from other computer(B) by .config file???

Please help me any way.....

推荐答案

将Atta2005 mdf文件保存在vb.net项目中.
如何更改您的连接字符串:
Save your Atta2005 mdf file in your vb.net project.

What about change your Connectionstring:
<add name="AttachmentDBConnection.My.MySettings.DatabaseConnectionString" connectionstring="Server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Atta2005.mdf;Database=Atta;Trusted_Connection=yes;User Instance=True">
      providerName="System.Data.SqlClient" />
</add>



希望能帮助到你.寻求改进;)



Hope it helps. Ask for improvements ;)


这篇关于到远程连接以附加.mdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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