We have a lively running business system with errors that occur from time to time coming from the asp.net membership provider Stack is according to trace. It does not matter which user is currently logged on as far as I can tell the ASP.NET subscription tables in the database.
Example of the code line that generates the error:
If (subscription. GETUser ()! = Null)
error details Type 'System.String' unable to type 'System.Int32' type to type
Stack trace: [InvalidCastException: Unable to type 'System.String' type of type 'System.Int32'.] System.Data .SqlClient.SqlBuffer.get_String () 141 System.Data.SqlClient .SqlDataReader.GetString (Int32 i) 96 System.Web.Security.SqlMembershipProvider.GetNullableString (SqlDataReader Reader, Int32 col) 35 System.Web.Security.SqlMembershipProvider GetUser (String Username, Boolean UserIns online) +1110 System Web. Security Membership GetUser (String Username, Boolean UserInsOnline) +82 System Web. Security Membership. Gateusur () +19
Does anyone have any wrong ideas?
Update: We could not resolve this error. But ultimately it was excluded.
Now when we go to another server this error completely casts off our application. I'm completely out of ideas: (
Enter an attempt / catch block around membership. GetUser () And log in the user name. You can get the user name by calling Membership.GetCurrentUserName ().
Once you have problems with a user name for this, Look at the membership table and check the comments in the field. My guess is that the comments There is something funny going on in the wild - there may be some strange unicode characters in which there are problems, or maybe there is too much data in that area, etc.
Also, try the user Calling dbo.aspnet_Membership_GetUserByName on the membership database for it is having trouble and seeing what you see.
Comments
Post a Comment