 |
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

December 12th, 2015, 05:39 PM
|
|
Registered User
|
|
Join Date: Dec 2015
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Chapter 16 - CreateUserWizard / Login Controls
Hi guys,
I'm having some trouble with the Login and CreateUserWizard controls discussed in chapter 16. I am able to get them into the page and they display fine when running the web site in debug mode but when I click the "login" or "create user" buttons I get the same "unhandled exception occurred during the execution of the current web request" error for each of them and dont know how to fix it.
It tells me that I have:
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'UserName'.
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'IsAnonymous'.
Invalid column name 'LastActivityDate'.
I have checked my web.config file connection strings against the books and it looks good to my eyes.
If anyone could advise me on the issue it would be appreciated. I also have an issue with the Web Site Administrator Tool but I'll post that in a separate thread. I thought I would raise it in case the two issues are related.
|
|

December 13th, 2015, 05:34 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Can you provide more information such as the actual error message + stack trace, version of Visual Studio and SQL Server and a description of your database content. Do you see the required tables for membership in your database?
Imar
|
|

December 13th, 2015, 05:56 PM
|
|
Registered User
|
|
Join Date: Dec 2015
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
Thanks for getting back to me, the answers to your questions are:
Quote:
|
version of Visual Studio and SQL Server and a description of your database content
|
Visual Studio 2015 Community
SQL Server Express 2014
I have a collection of tables in my database to store different types of data for different tasks. I have followed the instructions in the book and there have been tables generated automatically (Applications and Membership).
To try and fix the problem I have run aspnet_regsql.exe from the comand line and the has genereted some extra tables (all prefixed with aspnet_[table name]). I'm not sure to what table in the database the CreateUserWizard is pointing to?
The error message is displayed as follows:
Quote:
Server Error in '/' Application.
Operand type clash: uniqueidentifier is incompatible with int
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'UserName'.
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'IsAnonymous'.
Invalid column name 'LastActivityDate'.
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: Operand type clash: uniqueidentifier is incompatible with int
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'UserName'.
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'IsAnonymous'.
Invalid column name 'LastActivityDate'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
|
Code:
[SqlException (0x80131904): Operand type clash: uniqueidentifier is incompatible with int
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'UserName'.
Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'IsAnonymous'.
Invalid column name 'LastActivityDate'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2418102
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5694456
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +89
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +379
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2064
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +240
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +12
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c) +14
System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +72
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) +402
System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior) +166
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +12
System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +36
[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.]
System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +103
System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +758
System.Data.Entity.Core.Objects.<>c__DisplayClass7.<GetResults>b__6() +90
System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction(Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) +288
System.Data.Entity.Core.Objects.<>c__DisplayClass7.<GetResults>b__5() +154
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +190
System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +283
System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0() +15
System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() +45
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +121
System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1(IEnumerable`1 sequence) +40
System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +59
System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +114
System.Data.Entity.Internal.Linq.DbQueryProvider.Execute(Expression expression) +116
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +211
System.Web.Providers.QueryHelper.GetMembershipAndUser(MembershipContext ctx, String applicationName, String userName) +3536
System.Web.Providers.DefaultMembershipProvider.ValidateUser(String username, String password) +126
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +59
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +113
System.Web.UI.WebControls.Login.AttemptLogin() +119
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +75
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +164
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3562
|
|

December 16th, 2015, 10:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
That's really weird.
This error message:
Exception Details: System.Data.SqlClient.SqlException: Operand type clash: uniqueidentifier is incompatible with int
suggests that your ID columns in the database are of the wrong type.
How did you create the tables?
>> Visual Studio 2015 Community
That could be part of the problem where VS 2015 is installing n ewer versions of packages with different behavior. Did you install VS 2013 and does the problem occur there too?
Imar
|
|
 |
|