The 'server explorer' and the 'SQL management tools' are just some tools that can be used to connect to the database server, and you can browse the database (tables, stored procedures etc).
I prefer stored procedures, they are much better, faster and safer. you can pass parameters to a stored procedure, you can basically use it like a function. You can do much more if you use it.. You can read more about it here
http://databases.about.com/od/sqlser...dprocedure.htm
To connect to database, you will need to use something like a Connection String.
You need to setup the database on one machine. To access this database you will have to use connection string, where you supply the name of the server, the database name, the username and password to connect and then you perform the functions you want on that machine.
Once you've done that, doesnt matter which machine you install the application to, as long as that machine is in the network and can access the machine with the database, you will be fine.
Right click on your projet on Visual Studio, goto Properties.
Add a new row, Name= 'ConnectionString' or whatever you wanna call it. Type = 'string', Scope = 'Application' and Value will be something like this:
'server=DATABASE-SERVER;database=Db_Name;Username=username;Password=password'
You can now use this connection string anywhere in your application. A sample code for accessing the database and the connection string:
SqlConnection cn = new SqlConnection(MyProject.Properties.Settings.Default.ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText="your sql statement or the stored procedure name";
// if using a stored procedure
cmd.CommandType = CommandType.StoredProcedure;
// if using an sql command
cmd.CommandType = CommandType.Text;
cn.Open();
// if you are simply adding/modifying something on the database without returning anything
cn.ExecuteNonQuery();
cn.Close();
If your query is returning some values (SELECT etc), then you will have to use SqlDataReader.
string name, address, phone;
cmd.Open();
SqlDataReader dr = cmd.Execute Reader();
while (dr.Read())
{
//assuming Name, Address and Phone are the fields of a table.
name = dr["Name"].ToString();
address = dr["Address"].ToString();
phone = dr["Phone"].ToString();
}
cn.close();