Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I connect my local computer(A) through the config file & it is fine works.
My config file is :->
-------------------
XML
<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>

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.....
Posted
Updated 8-Aug-12 3:23am
v2
Comments
Christian Amado 8-Aug-12 9:23am    
@Member 7678194 use code tags on your question =)

1 solution

Save your Atta2005 mdf file in your vb.net project.

What about change your Connectionstring:
XML
<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 ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900