How do I connect to my database when I'm using IIS (connecting via http://localhost/...)

Discussion in 'ASP .Net' started by mark4asp, Mar 28, 2007.

  1. mark4asp

    mark4asp Guest

    How do I connect to my application via http://localhost/..., using
    IIS.

    I've developed an application via the File System (using the VS Web
    server). When I deploy it I change the <appSettings> From
    MyAppConnString_localhost to MyAppConnString_live (see config settings
    below).

    Up to now connections have worked fine.

    I've never developed via IIS but I want to now. That's because I've
    noticed that AJAX seems to work differently when the application is
    running via the File System (VS Web Server) or IIS.

    The problem is that as soon as I run my application, after connecting
    via LocalIIS, niether connection string (see below) is valid.

    Why not? What do I need to do locally via IIS and/or SQL Server
    Express to get this to work (using integrated security). Am I missing
    a machine account or user account?

    My account is a local machine administrator.

    This is the first time I've tried to connect via IIS since I upgraded
    using the recent upgrades for Win XP, VS (SP1) and SQL Server Express
    (SP2). I'm using VS 2005 Standard and WinXP SP2.


    <appSettings>
    <add key="connectionString" value="MyAppConnString_localhost"/>
    </appSettings>

    <connectionStrings>
    <add name="MyAppConnString_localdev" connectionString="Data Source=.
    \SQLEXPRESS;Integrated Security=True;Initial Catalog=MyApp_40"
    providerName="System.Data.SqlClient"/>
    <add name="MyAppConnString_live" connectionString="packet
    size=4096;user id=AliBaba;data source=.;persist security info=False;
    initial catalog=MyApp_40;password=letmein"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>
     
    mark4asp, Mar 28, 2007
    #1
    1. Advertising

  2. Make sure Anonymous Access is turned OFF in IIS for this to work, and
    Integrated Windows Authentication is turned ON.
    To configure this, goto site in IIS, right click->Properties-
    >Directory Security->Edit


    Latish
     
    Latish Sehgal, Mar 29, 2007
    #2
    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. Jiong Feng
    Replies:
    0
    Views:
    931
    Jiong Feng
    Nov 19, 2003
  2. Paul Glavich [MVP - ASP.NET]
    Replies:
    0
    Views:
    471
    Paul Glavich [MVP - ASP.NET]
    Jun 20, 2004
  3. George Hester
    Replies:
    0
    Views:
    468
    George Hester
    Aug 22, 2003
  4. SSG
    Replies:
    0
    Views:
    138
  5. Replies:
    2
    Views:
    327
Loading...

Share This Page