web.config

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
 
G

Guest

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
 
M

Mark Goldin

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" />
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top