Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
I create windows application of C# .net and also create setup file.I install setup file for machine(1 and 2).In 1st machine i use database(like Employee).i want to use same database for 2 machine using LAN connection.
Is it possible i install setup in 2 machine but use database use only from 1st machine.
Please help me.plzz..m new here.

Thanks
Posted
Comments
Sascha Lefèvre 28-Apr-15 16:56pm    
Which type of database?
Member 10852141 29-Apr-15 9:15am    
sql database.(db).please help

Data Source=Your distination IP,Your port;Network Library=DBMSSOCN;
Initial Catalog=Your Database Name;User ID=Your Username;Password=Your Password;


Example



Data Source=192.168.100.10,1433;Network Library=DBMSSOCN;
Initial Catalog=Employee;User ID=csharp;Password=csharp123;



Hope this will help you...
 
Share this answer
 
Comments
Member 10852141 29-Apr-15 7:17am    
Sir,Its nt working.
i install setup file in 2 machine(1 and 2) both have database but i want to access database from machine 1 for machine 2.machine 2 database is not useful to us.
Sir,i means if i update data from machine 2 it automatic update database of machine 1 also.
please one example how we do it.we use lan connection because its windows application no internet connection available.
plz suggest me briefly
Abu Khaleel 30-Apr-15 14:26pm    
Send us your database server name ie mysql or sql server etc. what connection or connection string are you using currently. your machine 1 username on which server is install and machine 2 on which you install the setup file. Beacuse in database server it is necessary to allow remote users.
we will try to find a fine solution for you.
Member 10852141 30-Apr-15 15:12pm    
connetionString="Data Source=harshal-pc;Initial Catalog=School;
User ID=harsh;Password=Password"

machine 1 harshal machine 2 atul
yes it is possible u have to include the IP of that system in connection string instead of local server
 
Share this answer
 
Comments
Member 10852141 29-Apr-15 5:26am    
Sir,can u give me one simple example.how it work??
i install setup file in 2 machine but i want use only one database(db) using lan connection.plz.one example.how we will written in connection string
yep. Its possible. Use Connection string
 
Share this answer
 
v2
Comments
Member 10852141 29-Apr-15 5:26am    
Sir,can u give me one simple example.how it work??
i install setup file in 2 machine but i want use only one database(db) using lan connection.plz.one example.how we will written in connection string
mammu2787 29-Apr-15 7:24am    
https://www.connectionstrings.com/sqlconnection/connect-via-an-ip-address/

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