a question about login in the latest release

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/26/2007 10:11:51 PM
Gravatar
Total Posts 28

a question about logon in the latest release

 Hi,joe

when I click the sign in button ,if  the email and password both right. no problem.

if the email and password both wrong , no problem.

if the email is right and the password is wrong, the problem occurs. it's pop up a new windows with these message:

Assertion Failed:Abort=Quit,Retry=Debug,Ignore=Contineu

Parameter's name doesn't match cached parameters

at sqlParameterHelper.DefineSqlParameter(string paramName..........................

9/27/2007 7:10:24 AM
Gravatar
Total Posts 18439

Re: a question about login in the latest release

Hi Wenjie,

This is a debug assert that was failing so this error was only raised by debugging in the source code. There is no runtime error in pre-compiled release files.

I've corrected the problem and uploaded a new source code zip.

Thanks,

Joe

9/27/2007 7:31:12 AM
Gravatar
Total Posts 28

Re: a question about login in the latest release

Thanks very much

9/27/2007 8:38:27 AM
Gravatar
Total Posts 28

Re: a question about login in the latest release

Hi joe

I meet the problem again in the latest release ,when I click the sign in  button .

now the error message is :

Invalid cast from 'System.Int32' to 'System.Guid'.
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.InvalidCastException: Invalid cast from 'System.Int32' to 'System.Guid'.

Source Error:


Line 340:
Line 341: // Finally, execute the command
Line 342: int retval = cmd.ExecuteNonQuery();
Line 343:
Line 344: // Detach the SqlParameters from the command object, so they can be used again


Source File: D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\SQLHelper.cs Line: 342

Stack Trace:


[InvalidCastException: Invalid cast from 'System.Int32' to 'System.Guid'.]
System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +867
System.Int32.System.IConvertible.ToType(Type type, IFormatProvider provider) +36
System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +606
System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) +908


........................

9/27/2007 9:13:13 AM
Gravatar
Total Posts 18439

Re: a question about login in the latest release

Hi Wenjie,

I don't see that error hereand I can't tell where it is happening from what you posted. Can you post more of the error message? I need to see where in dbPortal.cs this error is happening.

Thanks,

Joe

9/27/2007 10:05:01 AM
Gravatar
Total Posts 28

Re: a question about login in the latest release

hi joe

the total message is :

Server Error in '/mojo39' Application.
--------------------------------------------------------------------------------

Invalid cast from 'System.Int32' to 'System.Guid'.
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.InvalidCastException: Invalid cast from 'System.Int32' to 'System.Guid'.

Source Error:


Line 340:
Line 341: // Finally, execute the command
Line 342: int retval = cmd.ExecuteNonQuery();
Line 343:
Line 344: // Detach the SqlParameters from the command object, so they can be used again


Source File: D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\SQLHelper.cs Line: 342

Stack Trace:


[InvalidCastException: Invalid cast from 'System.Int32' to 'System.Guid'.]
System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +867
System.Int32.System.IConvertible.ToType(Type type, IFormatProvider provider) +36
System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +606
System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) +908

[InvalidCastException: Failed to convert parameter value from a Int32 to a Guid.]
System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) +958
System.Data.SqlClient.SqlParameter.GetCoercedValue() +29
System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc) +156
System.Data.SqlClient.SqlCommand.SetUpRPCParameters(_SqlRPC rpc, Int32 startCount, Boolean inSchema, SqlParameterCollection parameters) +116
System.Data.SqlClient.SqlCommand.BuildRPC(Boolean inSchema, SqlParameterCollection parameters, _SqlRPC& rpc) +71
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +947
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +149
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) in D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\SQLHelper.cs:342
mojoPortal.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\SQLHelper.cs:258
mojoPortal.Data.SqlParameterHelper.ExecuteNonQuery() in D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\SQLParameterHelper.cs:135
mojoPortal.Data.dbPortal.SiteUser_UpdateFailedPasswordAttemptCount(Guid userGuid, Int32 attemptCount) in D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Data.MSSQL\dbPortal.cs:1589
mojoPortal.Business.SiteUser.IncrementPasswordAttempts(SiteSettings siteSettings) in D:\mojoportal-2-2-3-9-sourcecode2\mojoPortal.Business\SiteUser.cs:882
mojoPortal.Web.mojoMembershipProvider.ValidateUser(String userName, String password) in D:\mojoportal-2-2-3-9-sourcecode2\Web\Components\mojoMembershipProvider.cs:1299
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1378; ASP.NET Version:2.0.50727.1378

 

 

thanks 

 

wenjie

9/27/2007 10:45:00 AM
Gravatar
Total Posts 18439

Re: a question about login in the latest release

Hi Wenjie,

That helped. I have corrected the problem and am uploading the sourcecode zip again now.

Its still uploading so wait a 5-10 minutes and you will see it.

Thanks,

Joe

9/27/2007 10:45:23 AM
Gravatar
Total Posts 28

Re: a question about login in the latest release

Hi joe

I have solved the problem.

change the code (in dbportal.cs)

public static bool SiteUser_UpdateFailedPasswordAttemptCount(
Guid userGuid,
int attemptCount)
{
SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Users_SetFailedPasswordAttemptCount", 2);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, attemptCount );
sph.DefineSqlParameter("@AttemptCount", SqlDbType.Int, ParameterDirection.Input, attemptCount);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);
}


to

public static bool SiteUser_UpdateFailedPasswordAttemptCount(
Guid userGuid,
int attemptCount)
{
SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Users_SetFailedPasswordAttemptCount", 2);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid );
sph.DefineSqlParameter("@AttemptCount", SqlDbType.Int, ParameterDirection.Input, attemptCount);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);

wenjie

9/27/2007 11:10:50 AM
Gravatar
Total Posts 18439

Re: a question about login in the latest release

Hi Wenjie,

Yes, that is the correct fix. I have already fixed it and uploaded again as mentioned in my previous post.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.