all groups > sql server connect > april 2006 >
You're in the

sql server connect

group:

login failed form web program


login failed form web program Landon Kelsey
4/22/2006 10:17:01 PM
sql server connect: I can connect easily using C# & ADO.NET on standalone programs.

I am trying to connect from a web site program under .NET 1.1 VS 7 and
always get

Login failed for user 'LANDON\ASPNET'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for
user
'LANDON\ASPNET'.

Source Error:


Line 46: private void Page_Load(object sender, System.EventArgs e)
Line 47: {
Line 48: sqlConnection1.Open();
Line 49: ds = new DataSet();
Line 50: daAttendees = new SqlDataAdapter(


Source File: c:\inetpub\wwwroot\pcswebapp2\webform1.aspx.cs Line: 48

having signed in under IE6 using:
http://localhost/PCSWebApp2/WebForm1.aspx
I've tried everything to fix the problem;

One of many connections strings:
this.sqlConnection2.ConnectionString =
"workstation id=LANDON\\sqlexpress;packet size=4096;integrated
security=SSPI;data source=\"landon\\sqlexpress\";persist security
info=False;initial catalog=netexamplesasp";

IE string = http://localhost/PCSWebApp2/WebForm1.aspx

Program built under C# 2003



Re: login failed form web program Jens
4/23/2006 6:00:20 AM
Do you want to impersonate the user, or do you want to use SQL
Authentication ? If you want to impersonate the user, you have to setup
the IIS to NOT allow anonymous connections and to use integrated
authentication. If the IIS is on the same server like the SQL Server
Service, this should work for you if the client (IE) is tranferring the
client credentials (IE settings)

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---
Re: login failed form web program Landon Kelsey
4/23/2006 8:00:01 AM
thanks but that did not work.

After making the changes, I stopped and restarted IIS.

I will keep looking in IIS since the problem MUST be there

Thanks again!

[quoted text, click to view]
AddThis Social Bookmark Button