Re: How to enable Windows Authentication



Thanks Alvin, either your missing something or I am missing something and I
think we have already established that I am missing something. I am new to
ASP.NET. :) I don't want to use SQL server. I don't need it, want it, or
care how to spell it. I am using Windows user accounts on my Windows 2003
server. These is doable right?

Your correct in that if i enable my sql connection string it works but that
is not my goal. I want to have a web application that authenticates with
Windows Local User accounts. That is possible correct?

Thanks for reading this!

"Alvin Bruney [ASP.NET MVP]" <vapor dan a t h u t ma le dut cu m> wrote in
message news:ekFldU9jJHA.4448@xxxxxxxxxxxxxxxxxxxxxxx
You 'known user' does not have access to sql server.

--
Regards,
Alvin Bruney

Auther Plug
OWC Blackbook now on download at www.lulu.com/owc

"JEFF" <jeffwi52@xxxxxxxxxxx> wrote in message
news:Oz1SLz7jJHA.5724@xxxxxxxxxxxxxxxxxxxxxxx
Greetings, I am trying to use Windows Authentication to control access to
my web app using information from
http://msdn.microsoft.com/en-us/library/ms998358.aspx. I have a very
simple page that has a single login control below. It compiles fine but
when I run it and authenticate with a known good user name and password
from my local machine I get the unhandled exception at the very end. If
I remove the comments from the connection string in the web.config I can
authenticate with using ASP.NET role user. Can someone give me a
web.config that would work in this scenario. I am using Windows 2003
server EE. Thanks in advance.

Web Page:

<body>
<div>
<form id="form2" runat="server">
<asp:login id="mylogin" FailureText="login failed" runat="server"
Width="100%" OnLoggedIn="mylogin_LoggedIn">
</asp:login>
</form>
</div>
</body>

Web.Config (notice the commented out connection string)

<configuration>
<appSettings/>
<connectionStrings>
<!--<remove name="LocalSqlServer" />
<add name="LocalSqlServer" providerName="System.Data.SqlClient"
connectionString="server=.;database=aspnetdb;Integrated
Security=SSPI"></add>
<add name="LocalSqlServer" connectionString="data
source=.\MSSQLSERVER;Integrated
Security=SSPI;AttachDBFilename=aspnetdb;User Instance=true"
providerName="System.Data.SqlClient" /> -->
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
</configuration>

Unhandled Exception:

An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 25 - Connection
string is not valid)



.



Relevant Pages

  • Re: One Connection String for Multiple Users (SQL)
    ... Hitchhiker’s Guide to Visual Studio and SQL Server ... "William Vaughn" wrote: ... This uses the> same connection string for all instances of the application. ...
    (microsoft.public.sqlserver.connect)
  • RE: How do I configure Analysis Services for Excel 2003 users?
    ... they had had Office 2003 installed AFTER SQL Server. ... > I have been preparing a set of cubes in Analysis Services 2005 to be viewed ... > Excel reports have been designed as pivot tables based on AS cubes, ... > Surely it must be that the connection string is incorrect but I seem to have ...
    (microsoft.public.sqlserver.olap)
  • Re: Connecting to Sql Server using an IP address
    ... using IP address without port number (default port number ... of SQL Server is 1433) cannot connect to the SQL Server on a remote ... name in the connection string can connect the remote machine successfully. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problem connecting to an SQL 2005 Express Instance in RANU mod
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... I'm using SQL2005 Express User Instance Feature. ... attaching an MDB file with the following connection string: ...
    (microsoft.public.sqlserver.connect)
  • asp.net 2.0 login control
    ... A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] ... These problems left me stranded for days, then today, on another machine, I hit a different set of problems I kept getting the following "Failed to generate user instance of SQL Server due to a failure in starting the process for the user instance. ... (Basically this is a new option in the connection string that allows you to point out where the ..mdf file resides eliminating the need to create database in some SQL instance.) ... Beware that the windows account of the user that first creates the connection in this databaseless manner, becomes exclusive user for this file and no other windows account will be able to create a connection to this file. ...
    (microsoft.public.dotnet.languages.vb)