web.config

Discussion in 'ASP .Net' started by Mark Goldin, Jan 21, 2004.

  1. Mark Goldin

    Mark Goldin Guest

    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
    Mark Goldin, Jan 21, 2004
    #1
    1. Advertising

  2. 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
    =?Utf-8?B?SmVyZW15?=, Jan 21, 2004
    #2
    1. Advertising

  3. Mark Goldin

    Mark Goldin Guest

    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" <> wrote in message
    news:...
    > 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
    Mark Goldin, Jan 21, 2004
    #3
  4. 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
    =?Utf-8?B?SmVyZW15?=, Jan 21, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVs?=

    Machine.config & web.config

    =?Utf-8?B?RGFuaWVs?=, Jan 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    13,296
    Hermit Dave
    Jan 18, 2004
  2. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=

    Web.Config Get Config settings at runtime.

    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,255
    Kevin Spencer
    Feb 6, 2004
  3. Bob
    Replies:
    7
    Views:
    957
    Saravana [MVP]
    May 5, 2004
  4. Benny Ng
    Replies:
    9
    Views:
    9,941
    Benny Ng
    Oct 13, 2005
  5. CSharpner
    Replies:
    0
    Views:
    1,013
    CSharpner
    Apr 9, 2007
Loading...

Share This Page