Description:
Can't use the following ASP.NET 2.0 built-in Membership provider-method in MySQL Connector/Net 5.1.4.
Public Shared Function FindUsersByEmail(ByVal emailToMatch As String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef totalRecords As Integer) As System.Web.Security.MembershipUserCollection
Member of: System.Web.Security.Membership
The following errormessage appears:
An exception occurred. Please check the Event Log. vid System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) vid System.Web.Administration.SecurityPage.SearchForUsers(Object sender, EventArgs e, Repeater repeater, GridView dataGrid, DropDownList dropDown, TextBox textBox) vid ASP.security_users_manageusers_aspx.SearchForUsers(Object sender, EventArgs e) vid System.Web.UI.WebControls.Button.OnClick(EventArgs e) vid System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) vid System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) vid System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) vid System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) vid System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
This is what the Event-log printed:
An exception occurred communicating with the data source.
Action: FindUsersByEmail
Exception: MySql.Data.MySqlClient.MySqlException: Parameter '?EmailSearch' has already been defined.
vid MySql.Data.MySqlClient.MySqlParameterCollection.InternalAdd(MySqlParameter value, Int32 index)
vid MySql.Data.MySqlClient.MySqlParameterCollection.Add(String parameterName, MySqlDbType dbType, Int32 size)
vid MySql.Web.Security.MySQLMembershipProvider.FindUsersByEmail(String emailToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
Mer information finns i Hjälp- och supportcenter på sidan http://go.microsoft.com/fwlink/events.asp.
How to repeat:
Use the method "Membership.FindUsersByEmail()" to find users registered.
The method "Membership.FindUsersByName()" on the other hand does NOT throw any Exception. The latter also correctly supports wildcard characters.
Suggested fix:
This is what the Event-log printed:
An exception occurred communicating with the data source.
Action: FindUsersByEmail
Exception: MySql.Data.MySqlClient.MySqlException: Parameter '?EmailSearch' has already been defined.
vid MySql.Data.MySqlClient.MySqlParameterCollection.InternalAdd(MySqlParameter value, Int32 index)
vid MySql.Data.MySqlClient.MySqlParameterCollection.Add(String parameterName, MySqlDbType dbType, Int32 size)
vid MySql.Web.Security.MySQLMembershipProvider.FindUsersByEmail(String emailToMatch, Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
Mer information finns i Hjälp- och supportcenter på sidan http://go.microsoft.com/fwlink/events.asp.