473,810 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 <appSettingsFro m
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="connection String" value="MyAppCon nString_localho st"/>
</appSettings>

<connectionStri ngs>
<add name="MyAppConn String_localdev " connectionStrin g="Data Source=.
\SQLEXPRESS;Int egrated Security=True;I nitial Catalog=MyApp_4 0"
providerName="S ystem.Data.SqlC lient"/>
<add name="MyAppConn String_live" connectionStrin g="packet
size=4096;user id=AliBaba;data source=.;persis t security info=False;
initial catalog=MyApp_4 0;password=letm ein"
providerName="S ystem.Data.SqlC lient"/>
</connectionStrin gs>

Mar 28 '07 #1
1 1941
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
4830
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " . mysql_error()); echo "Connected successfully"; mysql_close($link);
16
27926
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my linux box" will do nicely) Host/Server Name (or IP) - something like MSQLUserName@ServerName.net...
4
6478
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to define the servername / hostname in my Perl Progrem.. Here is the code:
0
2289
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres (enter)
1
4397
by: medvegonok | last post by:
I am trying to connect to MySQL database at on host (DBhost) from another host (PROGRAMhost). While I try to connect to the database at DBhost from DBhost itself the next is working fine for me: mysql_connect("localhost","qdbname","dbpassword") Now I am trying to find out what to use instead of localhost? I tried to replace localhost with host's url:port (I tried number of ports) but this is not working (even when I am connecting from...
2
29549
by: comp.lang.php | last post by:
when trying to use the mysql_real_escape_string() function, the following warning occurs: First of all, the user is not 'web' trying to connect to the database, secondly, what is mysql_real_escape_string() doing connecting to the database, as 'web' or anyone else, and thirdly, why is this happening, does anyone know?
3
2764
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if (Request.Form == null || Request.Form == "") { Session = "LocalHost"; }
3
1552
by: toyin | last post by:
hi, am having problem connecting to MYSQL5.1 from VS.Net.the error is database reeor:System.Data.SqlClient.SqlException:An error occur while establishnig a connection to the server. Am Using Visual Studio.Net 2003, IIS 5.0 and MySql5.1. am trying to retreve a new record from a database using a webservice. here is the sample code Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.Services
1
3149
by: servo | last post by:
I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges Then a simple script to connect to the database (as I am trying to locate the source of the errors), as per below: <?php $dbhost = "localhost"; $dbuser = "debscrof_test1"; $dbpass = "test2"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or...
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.