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

M

mark4asp

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>
 
L

Latish Sehgal

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top