Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to Database applications. I have one question. Suppose I have an application which is running on 10 PCs which are on the LAN. Each user on their PC enters and retrieves data.

Can I achieve this functionality by just using ConnectionString?
This means giving the address of database on the Server which is one of the 10 PCs on the LAN.
Posted
Updated 6-Jan-11 21:18pm
v3
Comments
OriginalGriff 7-Jan-11 3:35am    
Answer updated

1 solution

Yes. Sort of.

You would have a ConnectionString which supplies the address and login details for the database, but after that you need to supply code or browser html to access the database itself and enter / extract the records.

Note I would suggest that for the DB you look at MsSql or MySql, but avoid Access as the latter can be difficult to work int a multiuser environment. The other two are well used to it!


"i seems it was to difficult, i have to use TCP/IP and ETC....
But thank GOD and Thank for Answering that Just ConnectionString Do the whole the thing.........
thanks a lot......... - Pritesh Aryan 1 min ago"



It's not too difficult: at it's most basic:
C#
DataSet ds = new DataSet();
string sql = "SELECT * FROM myTable";
using (SqlConnection conn = new SqlConnection(connectionString)) 
   {
   conn.Open();
   using (SqlDataAdapter da = new SqlDataAdapter(sql, conn)) 
      {
      da.Fill(ds);
      }
   }
myDatagridview.DataSource = ds;
Will read all records from the "myTable" table and display them in WinForms. Similar code works for browser based systems.

You need to read up on this: there is a lot on the web, but try starting with MSDN and look at SQLConnection, it will at least give you the basics (if not the finer points - for that you will need a big, thick book!)
 
Share this answer
 
v2
Comments
Pritesh Aryan 7-Jan-11 3:28am    
i seems it was to difficult, i have to use TCP/IP and ETC....
But thank GOD and Thank for Answering that Just ConnectionString Do the whole the thing.........
thanks a lot.........
Dalek Dave 7-Jan-11 3:48am    
Great Answer, very comprehensive.
yaprig 7-Jan-11 4:05am    
my 5 points for this answer:)
Pritesh Aryan 7-Jan-11 4:31am    
@yaprig, ya you are right but you can also elaborate more
thatraja 7-Jan-11 13:27pm    
Good 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