Click here to Skip to main content
13,152,454 members (36,972 online)
Rate this:
 
Please Sign up or sign in to vote.
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 6-Jan-11 21:11pm
Updated 6-Jan-11 21:18pm
Slacker007108.5K
v3
Comments
OriginalGriff 7-Jan-11 3:35am
   
Answer updated

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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:
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!)
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 7 Jan 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100