Erreur du serveur dans l'application '/'.
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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: 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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1
Erreur source:
Ligne 1 : @{
Ligne 2 : WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", false);
Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com";
Ligne 4 : WebMail.EnableSsl = true;
Fichier source : e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne : 2
Trace de la pile:
[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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +195
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +73
MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +20
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) +90
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +367
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1286
MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar() +53
WebMatrix.Data.Database.QueryValue(String commandText, Object[] args) +122
WebMatrix.WebData.SimpleMembershipProvider.GetUserId(Database db, String userTableName, String userNameColumn, String userIdColumn, String userName) +234
WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +94
[InvalidOperationException: No user table found that has the name "userprofile".]
WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +198
WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider sMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +82
WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
ASP._Page__AppStart_cshtml.Execute() in e:\wwwroot\Mercuriale\_AppStart.cshtml:2
System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__3() +65
System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__a(Action action) +7
System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78
System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +202
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +41
[HttpException (0x80004005): Une exception de type 'System.Web.HttpException' a été levée.]
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +88
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +287
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +113
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71
System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +217
System.Web.HttpApplication.InitModulesCommon() +172
System.Web.HttpApplication.InitModules() +43
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
Is why I use MySQL and not MS SQL ?
Thanks by advance for the help
PS : "Mercuriale" database is declared in web.config file. I have already tried to use the WebSecurity.InitializeDatabaseConnection with all parameters like connectionString and providerName but same result.
[InvalidOperationException: No user table found that has the name "userprofile".]
Looks like you haven't created the userprofile table in your database. You've set the last parameter of the InitializeDatabaseConnection method to false, which tells the helper not to create tables if they do not exist. Change that to true.
Erreur de compilation
Description : Une erreur s'est produite lors de la compilation d'une ressource requise pour répondre à cette demande. Veuillez consulter ci-dessous les détails relatifs à l'erreur en question, puis modifier votre code source de manière appropriée.
Message d'erreur du compilateur: CS0103: The name 'ConfigurationManager' n'existe pas dans le contexte actuel
Erreur source:
Ligne 1 : @{
Ligne 2 : WebSecurity.InitializeDatabaseConnection(ConfigurationManager.ConnectionStrings["Mercuriale"].ConnectionString, "userprofile", "UserID", "Login", true);
Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com";
Ligne 4 : WebMail.EnableSsl = true;
Fichier source: e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne: 2
I think i have not placed your code at the good place but for now i'm lost.
Sorry Webmatrix answer me in French but it say that
The name 'ConfigurationManager' does not exist inthe current context
I had replace the line with your (and it's the same that MSDN). Now my error is :
Erreur du serveur dans l'application '/'.
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 'IDENTITY,
RoleName nvarc' at line 2
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: 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 'IDENTITY,
RoleName nvarc' at line 2
Erreur source:
Ligne 1 : @{
Ligne 2 : WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", true);
Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com";
Ligne 4 : WebMail.EnableSsl = true;
Fichier source : e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne : 2
Trace de la pile:
[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 'IDENTITY,
RoleName nvarc' at line 2]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +195
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +73
MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +20
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) +90
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +367
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1286
MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +36
WebMatrix.Data.Database.Execute(String commandText, Object[] args) +122
WebMatrix.WebData.SimpleRoleProvider.CreateTablesIfNeeded() +126
WebMatrix.WebData.WebSecurity.InitializeRoleProvider(SimpleRoleProvider sRoles, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +73
WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +94
WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
ASP._Page__AppStart_cshtml.Execute() in e:\wwwroot\Mercuriale\_AppStart.cshtml:2
System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__3() +65
System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__a(Action action) +7
System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78
System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +202
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +41
[HttpException (0x80004005): Une exception de type 'System.Web.HttpException' a été levée.]
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +88
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +287
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +113
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71
System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +217
System.Web.HttpApplication.InitModulesCommon() +172
System.Web.HttpApplication.InitModules() +43
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.0.30319.272
Is it possible SQL request to MySQL and MSSQL are not the same and the WebSecurity bug because this ?
But, a table webpages_membership was created when i had launch the page for the first time.
Yes, unfortunately, we don't yet support MySQL. :( We are looking into it though. There are certain differences in how we look at schema that work in Microsoft SQL Server that don't work in MySQL. Also, in our core Database class there's a method we use
called GetLastInsertId that is specific to how Microsoft T-SQL works. These can definitely be updated in the future to support MySQL, but we do not support it at this time, sorry.
In the meantime, one (not good, but not horrible) solution would be to have two databases. Use SQL Compact (.sdf file in App_Data) to store membership information and use MySQL to store the rest of your data. We believe that should work if you want to look
into that option.
Erik Porter
ASP.NET PM
http://about.me/erikporter
Marked as answer by Saesee on Feb 08, 2012 07:05 AM
Saesee
Member
33 Points
26 Posts
MySQL and WebSecurity.InitializeDatabaseConnection
Feb 06, 2012 01:33 PM|LINK
Hi,
In my site, i try to use the WebSecurity Class like the exemple site in Webmatrix.
I use a MySQL database and when i put the code in the _AppStart.cshtml file, my website is in an error.
My _AppStart.cshtml file :
@{ WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", false); WebMail.SmtpServer = "smtp.myserver.com"; WebMail.EnableSsl = true; WebMail.UserName = "MyUserNameOfTHEd3@th"; WebMail.Password = "ThEugggESTpassEVER"; WebMail.From = "myemail@provider.tld"; }My error :
Erreur du serveur dans l'application '/'. 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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1 Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code. Détails de l'exception: 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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1 Erreur source: Ligne 1 : @{ Ligne 2 : WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", false); Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com"; Ligne 4 : WebMail.EnableSsl = true; Fichier source : e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne : 2 Trace de la pile: [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] FROM [userprofile] WHERE (UPPER([Login]) = 'Z')' at line 1] MySql.Data.MySqlClient.MySqlStream.ReadPacket() +195 MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +73 MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +20 MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) +90 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +367 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1286 MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar() +53 WebMatrix.Data.Database.QueryValue(String commandText, Object[] args) +122 WebMatrix.WebData.SimpleMembershipProvider.GetUserId(Database db, String userTableName, String userNameColumn, String userIdColumn, String userName) +234 WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +94 [InvalidOperationException: No user table found that has the name "userprofile".] WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +198 WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider sMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +82 WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51 WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51 ASP._Page__AppStart_cshtml.Execute() in e:\wwwroot\Mercuriale\_AppStart.cshtml:2 System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__3() +65 System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__a(Action action) +7 System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78 System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +202 System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +41 [HttpException (0x80004005): Une exception de type 'System.Web.HttpException' a été levée.] System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +88 System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +287 System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +113 System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71 System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +217 System.Web.HttpApplication.InitModulesCommon() +172 System.Web.HttpApplication.InitModules() +43 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327Is why I use MySQL and not MS SQL ?
Thanks by advance for the help
PS : "Mercuriale" database is declared in web.config file. I have already tried to use the WebSecurity.InitializeDatabaseConnection with all parameters like connectionString and providerName but same result.
mysql
bbcompent1
All-Star
32994 Points
8509 Posts
Moderator
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 06, 2012 05:03 PM|LINK
You have to tell the system where this connection string actually lives so in your code, refer to it in your init string like this:
WebSecurity.InitializeDatabaseConnection(ConfigurationManager.ConnectionStrings["Mercuriale"].ConnectionString)
that connectionstring name already has your connection bits so you shouldn't need to specify the details again and again.
mysql
Mikesdotnett...
All-Star
154901 Points
19864 Posts
Moderator
MVP
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 06, 2012 06:23 PM|LINK
Looks like you haven't created the userprofile table in your database. You've set the last parameter of the InitializeDatabaseConnection method to false, which tells the helper not to create tables if they do not exist. Change that to true.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Saesee
Member
33 Points
26 Posts
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 07, 2012 07:25 AM|LINK
Hi,
My table userprofile exist with columns "UserID" "Email" and "Login".
I had replaced my code and the false by a true but don't work.
My table :
Table : userprofile Columns : - UserID [int, auto_increment, Primary, NOT NULL] - Login [varchar, NULL] - Email [varchar, NULL]My _AppStart.cshtml :
@{ WebSecurity.InitializeDatabaseConnection(ConfigurationManager.ConnectionStrings["Mercuriale"].ConnectionString, "userprofile", "UserID", "Login", true); WebMail.SmtpServer = "smtp.myserv.com"; WebMail.EnableSsl = true; WebMail.UserName = "LoginOfTheD3@th"; WebMail.Password = "BiggestPassEver"; WebMail.From = "mail@myserv.com"; }My web.config :
<?xml version="1.0" encoding="UTF-8"?> <configuration> <connectionStrings> <add name="Mercuriale" connectionString="Server=IP.IP.IP.IP;Database=mercuriale;Uid=LOGIN;Pwd=PASSWORD" providerName="MySql.Data.MySqlClient" /> </connectionStrings> <system.data> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=MYPUBTOKEN" /> </DbProviderFactories> </system.data> <system.webServer> <defaultDocument> <files> <clear /> <add value="default.cshtml" /> <add value="Default.html" /> <add value="Default.htm" /> <add value="index.cshtml" /> <add value="index.html" /> <add value="index.htm" /> </files> </defaultDocument> </system.webServer> <!-- A SUPPRIMER AVANT PROD !! --> <system.web> <customErrors mode="Off"/> </system.web> <!-- A SUPPRIMER AVANT PROD !! --> </configuration>My error :
Erreur de compilation Description : Une erreur s'est produite lors de la compilation d'une ressource requise pour répondre à cette demande. Veuillez consulter ci-dessous les détails relatifs à l'erreur en question, puis modifier votre code source de manière appropriée. Message d'erreur du compilateur: CS0103: The name 'ConfigurationManager' n'existe pas dans le contexte actuel Erreur source: Ligne 1 : @{ Ligne 2 : WebSecurity.InitializeDatabaseConnection(ConfigurationManager.ConnectionStrings["Mercuriale"].ConnectionString, "userprofile", "UserID", "Login", true); Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com"; Ligne 4 : WebMail.EnableSsl = true; Fichier source: e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne: 2I think i have not placed your code at the good place but for now i'm lost.
Sorry Webmatrix answer me in French but it say that
Mikesdotnett...
All-Star
154901 Points
19864 Posts
Moderator
MVP
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 07, 2012 08:03 AM|LINK
You only need to pass in the name of the connection string:
WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", true);Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Saesee
Member
33 Points
26 Posts
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 07, 2012 09:43 AM|LINK
Thanks Mike, i have understand that :) but...
I had replace the line with your (and it's the same that MSDN). Now my error is :
Erreur du serveur dans l'application '/'. 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 'IDENTITY, RoleName nvarc' at line 2 Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code. Détails de l'exception: 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 'IDENTITY, RoleName nvarc' at line 2 Erreur source: Ligne 1 : @{ Ligne 2 : WebSecurity.InitializeDatabaseConnection("Mercuriale", "userprofile", "UserID", "Login", true); Ligne 3 : WebMail.SmtpServer = "smtp.gmail.com"; Ligne 4 : WebMail.EnableSsl = true; Fichier source : e:\wwwroot\Mercuriale\_AppStart.cshtml Ligne : 2 Trace de la pile: [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 'IDENTITY, RoleName nvarc' at line 2] MySql.Data.MySqlClient.MySqlStream.ReadPacket() +195 MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +73 MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +20 MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) +90 MySql.Data.MySqlClient.MySqlDataReader.NextResult() +367 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1286 MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +36 WebMatrix.Data.Database.Execute(String commandText, Object[] args) +122 WebMatrix.WebData.SimpleRoleProvider.CreateTablesIfNeeded() +126 WebMatrix.WebData.WebSecurity.InitializeRoleProvider(SimpleRoleProvider sRoles, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +73 WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +94 WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51 ASP._Page__AppStart_cshtml.Execute() in e:\wwwroot\Mercuriale\_AppStart.cshtml:2 System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__3() +65 System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__a(Action action) +7 System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78 System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +202 System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +41 [HttpException (0x80004005): Une exception de type 'System.Web.HttpException' a été levée.] System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +88 System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +287 System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +113 System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71 System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +217 System.Web.HttpApplication.InitModulesCommon() +172 System.Web.HttpApplication.InitModules() +43 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327 Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.0.30319.272Is it possible SQL request to MySQL and MSSQL are not the same and the WebSecurity bug because this ?
But, a table webpages_membership was created when i had launch the page for the first time.
HumanCompile...
Member
511 Points
100 Posts
Microsoft
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 07, 2012 09:41 PM|LINK
Yes, unfortunately, we don't yet support MySQL. :( We are looking into it though. There are certain differences in how we look at schema that work in Microsoft SQL Server that don't work in MySQL. Also, in our core Database class there's a method we use called GetLastInsertId that is specific to how Microsoft T-SQL works. These can definitely be updated in the future to support MySQL, but we do not support it at this time, sorry.
In the meantime, one (not good, but not horrible) solution would be to have two databases. Use SQL Compact (.sdf file in App_Data) to store membership information and use MySQL to store the rest of your data. We believe that should work if you want to look into that option.
ASP.NET PM
http://about.me/erikporter
Saesee
Member
33 Points
26 Posts
Re: MySQL and WebSecurity.InitializeDatabaseConnection
Feb 08, 2012 07:07 AM|LINK
Thanks for the confirmation.
I will question my boss to know if we can use a SQLCompact but not sure.