Groups | Blog | Home
all groups > dotnet setup > march 2005 >

dotnet setup : How to connect to a different instance of a sql server


Novapol
3/31/2005 11:29:05 AM
Hi, how do i configure my web.config file? I have to use a sql database on
the same server in which the aspx application resides, however i want to use
another instance of the sql database called 'Myserver/MyInstance/'

the code looks like this and it addresses the default instance

<appSettings>
<add key="connectionString"
value="Server=localhost;Database=JS;uid=sa;pwd=password" />
<add key="ConexionOle"
value="Provider=SQLOLEDB;SERVER=localhost;UID=sa;PWD=password;DATABASE=JS;Connect Timeout=1800;" />
</appSettings>

Vipul Patel
4/5/2005 11:41:08 AM
Hello Navopal,

<appSettings>
<add key="connectionString"
value="Server=localhost\MyInstance;Database=JS;uid=sa;pwd=password" />
<add key="ConexionOle"
value="Provider=SQLOLEDB;SERVER=localhost\MyInstance;UID=sa;PWD=password;DATABASE=JS;Connect Timeout=1800;" />
</appSettings>

should do the trick. (Appending the instance name to the server demarcatedb
y \)

Do revert if this does not work.

Regards
Vipul


[quoted text, click to view]
AddThis Social Bookmark Button