A single instance of SQL server can use a MDF file only.
Just connect to the IP address or computer name of your SQL server for the other machines instead of attaching a MDF file for each.
EDIT:
Assuming
computernameoftheserver
is name of the hosting database and
dbname
is your database name :
SqlConnection con = new SqlConnection("data source=computernameoftheserver;integrated security=sspi; initial catalog=dbname;");
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("select * from tablename", con);
Dataset ds;
sda.Fill(ds);