Bug #71540 Sintaxe erro with 6.8.3 and EF6 at .NET 4.0
Submitted: 31 Jan 2014 3:41 Modified: 20 Jun 2014 21:47
Reporter: Anibal Sa Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6,8,3 OS:Microsoft Windows
Assigned to: Francisco Alberto Tirado Zavala CPU Architecture:Any
Tags: EF6 Simplemembership MVC 4

[31 Jan 2014 3:41] Anibal Sa
Description:
Hi ALL,
I will paste bellow the error about SQL Sintaxe working EF6 and Simplemembership.
The tables are being createds ok at initialize of application such as all migrations process. But when click to register a new user at website, occour the error.
There is a fix to improvemment the SQL sintaxe working with Simplemembership(WebMatrix.Data) to ASP.NET 4.0? If not, any suggestions about other Membership Provider to work with MVC 4?
Thanks a lot and my apolgies for my basic english!

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[UserId], [ConfirmationToken] FROM webpages_Membership WHERE [ConfirmationToken]' at line 1

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: MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[UserId], [ConfirmationToken] FROM webpages_Membership WHERE [ConfirmationToken]' at line 1

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:

[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[UserId], [ConfirmationToken] FROM webpages_Membership WHERE [ConfirmationToken]' at line 1]
   MySql.Data.MySqlClient.MySqlStream.ReadPacket() +278
   MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +73
   MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) +20
   MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +110
   MySql.Data.MySqlClient.MySqlDataReader.NextResult() +742
   MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1576
   MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +4
   System.Data.Common.DbCommand.ExecuteReader() +12
   WebMatrix.Data.<QueryInternal>d__0.MoveNext() +158
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   WebMatrix.Data.Database.Query(String commandText, Object[] parameters) +97
   WebMatrix.WebData.DatabaseWrapper.Query(String commandText, Object[] parameters) +17
   WebMatrix.WebData.SimpleMembershipProvider.ConfirmAccount(String accountConfirmationToken) +142
   SimpleMembership.Filters.SimpleMembershipInitializer..ctor() +232

How to repeat:
I dont understanding this area here. Sorry!
[21 Feb 2014 16:06] Fernando Gonzalez.Sanchez
Thanks for you bug report. 

WebMatrix's SimpleMembership is not currently supported.

The best alternative right now is to use the MembershipProvider available since ASP.NET 2.0: http://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-asp-roles.html
[20 May 2014 21:47] Francisco Alberto Tirado Zavala
Hello Anibal Sa.

As Fernando told you in his reply, SimpleMembership is not currently supported on Connector/Net 6.8.x, but you can use it on ConnectorNet 6.9.0.

Version 6.9.0 is on Alpha, we don't recommend to use it on Production environment, but you can use it for test/personal purposes: https://blogs.oracle.com/MySqlOnWindows/entry/mysql_connector_net_6_9

Thanks for your time.
[21 Jun 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".