Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Apr 23, 2013 @ 18:00
    Dan Diplo
    0

    SQL Error after Login

    This looks like an awesome package, but unfortunately I'm getting an SQL error after loging in using the AD username / password (step 6 in the guide). I'm using Umbraco 4.11.6 and the error is:

    The parameterized query '(@lang nvarchar(2),@name nvarchar(10),@lname nvarchar(10),@email' expects the parameter '@email', which was not supplied.

    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: The parameterized query '(@lang nvarchar(2),@name nvarchar(10),@lname nvarchar(10),@email' expects the parameter '@email', which was not supplied.

    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.

    Stack Trace: 

    [SqlException (0x80131904): The parameterized query '(@lang nvarchar(2),@name nvarchar(10),@lname nvarchar(10),@email' expects the parameter '@email', which was not supplied.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2073486
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064444
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +215
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +178
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) +56
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +83
       umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) +21
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +86
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +206
       umbraco.BusinessLogic.User.MakeNew(String name, String lname, String passw, String email, UserType ut) +301
       umbraco.cms.presentation.login.ActiveDirectoryMapping(String loginName, String email) +50
       umbraco.cms.presentation.login.Button1_Click(Object sender, EventArgs e) +382
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
  • John Ligtenberg 53 posts 214 karma points
    Apr 24, 2013 @ 00:05
    John Ligtenberg
    0

    Hello Dan,

    I'll look into it asap.

    John

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Apr 24, 2013 @ 11:34
    Dan Diplo
    0

    Thanks, John! After some research it appears the error is related to this issue:

    http://issues.umbraco.org/issue/U4-432

    In short, the AD user account *must* have an email address associated with it. Not sure if this is anything you can code around?

  • John Ligtenberg 53 posts 214 karma points
    Apr 24, 2013 @ 22:16
    John Ligtenberg
    100

    Hello Dan,

    I've written a new version of CustomUsersMembershipProvider.cs. You can download the file from the project page (under Hot Fix/ upgrade files) and place it in the App_code directory. This version only fills in the email address if available.

    Please remove the file CreateUserHandler.cs, as it is superfluous now.

    John

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Apr 25, 2013 @ 12:36
    Dan Diplo
    0

    Hi John,

    That's fantastic! I appreciate the support you've given - thanks for your fantastic project and help :)

Please Sign in or register to post replies

Write your reply to:

Draft