Sql Server on another computer

Topics: ASP.NET 2.0
Mar 17, 2010 at 5:33 PM

Hi all,

if i use a SQL Server, the Database can reside on another computer than the web server?

is it preferable to use sql server 2005 or 2008?


PS: Sorry  for my english.

Mar 18, 2010 at 8:36 AM



Mar 18, 2010 at 10:12 AM

Yes, you can have BE on one server and the DB on another server.  As long as there is network connectivity between the two servers, this can be done.

No matter where the DB is, you need to setup the Connection String in the web.config file so it has the correct DB, Username and Password.  The connection string setting in the web.config file looks similar to:

<add name="BlogEngine" connectionString="Data Source=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" providerName="System.Data.SqlClient"/>

For the "Data Source" value, you would enter the name or IP address of the server.  In the example above the value is a dummy value "MySQLServer".  A real connection string might look like the following.  Note that I used an IP address ( to indicate the IP address of where the DB is.

<add name="BlogEngine" connectionString="Data Source=;User ID=bloguser;Password=sfw98fw8f;persist security info=False;initial catalog=BlogEngine;" providerName="System.Data.SqlClient"/>

Mar 18, 2010 at 10:13 AM
Ok, thank you very much.