Server name in SQL connection string

davebhoy

Active member
Joined
Aug 22, 2006
Messages
26
Programming Experience
1-3
Hi there

I have specified a SQL connection string allowing for distribution of the published web app to different client locations. This is becuase the server names will be different in each location. The SQL string is as follows:

Dim server_name As String = Server.MachineName
ConnStrSQL = "Server=" & server_name & ";Database=ccas_drep;Trusted_Connection=True;"

I've just realised that the SQL server may not be on the same server as the web application and may cause a problem? Server.machineName will be the web app server, not necessarily the SQL server.

How do I get the string to pick up the SQL server name without specifying it directly?

Thanks in advance guys!

Dave
 
Back
Top