I think there is a confusion on how web application works with database.
First thing web application resides on the server machine. And even if somebody is accessing your web application from client machine, it uses the same web application hosted on the server. So you don't need to write separate data connectivity code for each client machine. Also you will have only one copy of application and one copy of database which will be shared across all the clients.
Second if your database and web application is on the same server then you can use following connection string in your application.
SqlConnection conn = new SqlDbConnection();
conn.ConnectionString =
"Data Source=ServerName;" +
"Initial Catalog=DataBaseName;" +
"User id=UserName;" +
"Password=Secret;";
conn.Open();
Reply back if you need anything more. Hope this helps you.