简体   繁体   中英

Connecting to database over a network using a IP address

Please I have a little issue with an application I am developing. I developed the application so that another system can connect to it vi a network. The connected system should be able to access the database of the application from the other system. the application is developed in C# and uses SQL server as database. I want the application installed on two system with one of the systems hosting the database and the other accessing it over the network. Below is a my config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="NewConnectionString"
            connectionString="Data Source=.\SQLSERVER;AttachDbFilename=C:\Hospital\HospitalDB.mdf;Integrated Security=True; User Instance = False"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>

please any help wll be deeply appreciated .

Your connection string specifies that DB engine should attach a local database file, rather than connect to remote server.

See ConnectionStrings.com to find suitable connection string for your purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM