1

I want to share my SQL Server 2008 R2 database between some computers on the same network(WiFi). How can I do so?

I mean I just want two users access the same Database through a network(WiFI). Both can use database, update database, delete data from database is it possible ?

I am using Windows application C#.

abedh
  • 11
  • 3

2 Answers2

0

It should be possible:
1. You need to know the IP-address (or name) of the computer running the server.
2. Setup a SQL server user (or use SA if you don't care about security).
3. Use the IP-address of the computer running the SQL Server and use the SQL Server user defined in step 2 for the login.

Björn
  • 3,098
  • 2
  • 26
  • 40
0

What have you tried? What is not working?

The most straight forward solution is to access the database by a SQL authentication (user/password) and use connection string similar to below where datasource is your database local IP address

<add name="connectionstring"  connectionString="Data Source=192.168.1.x;Initial Catalog=DATABASENAME;Persist Security Info=True;User ID=username;Password=password   ..." providerName="System.Data.SqlClient" />
Mike Nowak
  • 313
  • 1
  • 7
  • i have already tried connection my computer with database at same computer.. this is my coding ' private void button3_Click(object sender, EventArgs e) { string connectionString = @"Server=ABEDH-PC\SQLEXPRESS;Database=HL7;Integrated Security=SSPI"; string sql = "SELECT * FROM FROMPenerima"; ' now, what must i do at my another computer? i want my another computer can acces database it(ABEDH-PC\SQLEXPRESS) too. – abedh Apr 11 '15 at 13:18
  • **1)** Aren't you using Windows Authentication on the SQL server (it authenticates you by your logged user, so you don't have to provide username/password). Use SQL Authentication - Create a user in Databse, give him permissions to your HL7 database. Use this username and password as `USER Id` and `Password` in your connection string. Check if this works on _your_ computer. Than check the same thing on the _other_ one. **2)** Have you tried accessing that database from another computer in SQL Managment Studio or _Server Browser_ in Visual Studio? Can you see the database? Can you access it? – Mike Nowak Apr 11 '15 at 16:52
  • 1) Okay now i have already create username and password. This is work on my computer. i can acces my database.(username : ahay, password : ahay) 2) I can't accessing that database from another computer. this is my query [ select * from openrowset('SQLOledb', '192.168.1.1';'ahay';'ahay','select *from HL7..FromPenerima')]. 192.168.1.1 is ip address another computer, my computer and another computer have already connect to same WiFi. is there something wrong with my query? @Mike Nowak – abedh Apr 13 '15 at 14:57