Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebSecurity.CreateUserAndAccount Sql Collation Issue

If Sql Server database collation is Turkish_CI_AS, I get that error at below cause UPPER function in SELECT Query in "GetUserId" method of SimpleMembershipProvider.cs class.

SQL UPPER('info') is not equal to "info".ToUpperInvariant() in Turkish_CI_AS

Sql Server Database Collation : Turkish_CI_AS

WebSecurity.CreateUserAndAccount("info", "123456");

Exception Details: System.Web.Security.MembershipCreateUserException: The Provider encountered an unknown error.

like image 913
Kaan Avatar asked Aug 10 '26 20:08

Kaan


1 Answers

You should change the collation of UserProfile.UserName column in DB from Turkish_CI_AS to Latin1_General_CI_AS or any other at the moment. So, this must be bug.

like image 160
Onur Gazioğlu Avatar answered Aug 13 '26 11:08

Onur Gazioğlu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!