web.config

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

What do I need to change in order to connect my databse:
server name is devsrv01, database is treeview

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!-- Modify connection string file to point
to your SQL Server database -->
<add key="ConnectionString"
value="server=localhost;UID=sa;PWD=admin;DATABASE=Test" />
</appSettings>
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Windows" />
<trace enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

</system.web>

</configuration>

Thanks
 
That all depends on how your application is configured to work, but from the looks of it I'd say you need to change

<add key="ConnectionString" value="server=localhost;UID=sa;PWD=admin;DATABASE=Test" /

to something like

<add key="ConnectionString" value="server=devsrv01;UID=sa;PWD=admin;DATABASE=treeview" /

HTH
Jeremy
 
I tried that.
Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server
connection

This net (yes) stuff is killing me.

Jeremy said:
That all depends on how your application is configured to work, but from
the looks of it I'd say you need to change:
<add key="ConnectionString"
value="server=localhost;UID=sa;PWD=admin;DATABASE=Test" />
to something like:

<add key="ConnectionString"
value="server=devsrv01;UID=sa;PWD=admin;DATABASE=treeview" />
 
Well the UID needs to be a database account that has access to the treeview database, and the PWD needs to be the password for that account. It is highly recommended to NEVER NEVER NEVER use the sa (system admin) account when connecting to a database

HTH
Jeremy
 
Back
Top