Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# database LAN
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 22:11pm
Edited 6-Jan-11 22:18pm
Slacker00775.8K
v3
Comments
OriginalGriff at 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
thatraja at 7-Jan-11 13:27pm
   
Good answer
yaprig at 7-Jan-11 4:05am
   
my 5 points for this answer:)
Pritesh Aryan at 7-Jan-11 4:31am
   
@yaprig, ya you are right but you can also elaborate more
Dalek Dave at 7-Jan-11 3:48am
   
Great Answer, very comprehensive.
Pritesh Aryan at 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.........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 275
1 OriginalGriff 230
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 7 Jan 2011
Copyright © CodeProject, 1999-2014
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