J
JEFF
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)
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)