469,931 Members | 1,831 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,931 developers. It's quick & easy.

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

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

Mar 28 '07 #1
1 1791
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

Mar 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Mr Dygi | last post: by
2 posts views Thread by comp.lang.php | last post: by
3 posts views Thread by LamSoft | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.