Had same issue - stopping me from moving forward.
I have had the same issue. Here are some details.
I created the website as suggested in Ch 1 and went through the steps as carefully as I could.
However, one difference - I created the database in SQLServer 2005 Developer first and ran the script with additional data provided in the FinalDBScriptWithData, so was starting with a precreated database. The database was created to use Integrated Security.
However, for the web site creation, in the Readme.txt of the downloaded code, it states: "When creating the virtual directory in IIS you must disable Annoymous access to the site and enable Integrated Windows authentication."
I checked the settings of the IIS Virtual Dirctory for these and they did not appear to be set by Visual Studio after the solution creation following Ch 1 instructions as the readme stated they should be.
I have tried to run the Ch 2 code both as it was created with Anonymous Access enabled and disabled.
To disable the Anonymous Access, I opened the virtual directory properties dialog from IIS management app, and under the Directory Security tab, clicked the Edit... button to edit the Anonymous access and authentication configuration. I unchecked the "Anonymous access" checkbox and checked the "Integrated Windows Authentication" checkbox.
After going through the creation of the p 28, and selecting view in Browser, I first get a logon dialog though which I log on with my username and password for my local machine (I was surprised to get this...).
Then when I click the button I get the following error message:
Server Error in '/SPSLFF08UI' Application.
--------------------------------------------------------------------------------
Login failed for user 'CHIONA-M6400\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 'CHIONA-M6400\ASPNET'.
Source Error:
Line 40: db.ENTUserAccounts.InsertOnSubmit(userAccount);
Line 41: //Save the changes to the database
Line 42: db.SubmitChanges();
Line 43: }
Line 44: }
Source File: d:\data\Shaw\Projects\source\Test Projects\SPSLFFSolutionVS2008\SPSLFF08UI\Default.a spx.cs Line: 42
Stack Trace:
[SqlException (0x80131904): Login failed for user 'CHIONA-M6400\ASPNET'.]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Data.Linq.DataContext.SubmitChanges(Conflic tMode failureMode) +331
System.Data.Linq.DataContext.SubmitChanges() +19
_Default.btnInsert_Click(Object sender, EventArgs e) in d:\data\Shaw\Projects\source\Test Projects\SPSLFFSolutionVS2008\SPSLFF08UI\Default.a spx.cs:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
|