Solved

MySQL ASP.Net Membership Provider

Posted on 2009-04-13
4
1,114 Views
Last Modified: 2012-05-06
I am trying to implement the Membership provider in ASP.Net and not having an easy time going about this. There are several tutorials I have followed in detail however I must be missing something.

Both of the Following Tutorials are to my understanding using the same technique in modifying the Machine.Config file to get ASP.net's Dev Server Config Tool to be able to see the MySql Connector.

Heres my checklist
1.) I am programming in asp/Vb.Net VS2005
2.) I uninstalled my latest copy of DotNet Connector and installed the 5.2.2.0 as requested in the tutorial.
3.) I have copied the requested DLL's(Mysql.web.dll and mysql.data.dll) into a Bin folder within my webapps directory.
4.) I have added a Connection string in my Web.Config File as follows
***See Code Section (Web.Config)
5.) I have changed the authentication mode to "Forms"
6.) I have modified my Machine.config
***See Code Section (Machine.Config)

The Problem i am getting is when I open the 'Asp.net Configuration Tool' and click on the 'Security' tab I get the following error. ***"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. The following message may help in diagnosing the problem. Unable to initialize provider. Missing or incorrect schema.

I am unsure where to go from here. I am quite new to ASP.net although i've been a console programmer for a number of years. I have never used the membership provider and wanted to learn about it, however at my company we exclusively use MySQL.

Any suggestions or help will be greatly appreciated it. I've spent the last week trying to get this implemented and I'm about ready to give up and just do roles management without using these nice controls provided out of the box by Visual Studio.

Referenced Tutorials
http://xspgroup.wordpress.com/2008/09/09/aspnet-authorization-authentication-with-mysql/
http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx
-Web.Config

<connectionStrings>

    <remove name="LocalMySqlServer"/>

    <add name="LocalMySqlServer" connectionString="Server=MyIP; Database=POSUtil; Uid=root; Pwd=MyPW;" providerName="MySql.Data.SqlClient" />

  </connectionStrings>

 

-Machine.Config

  <system.web>

    <processModel autoConfig="true" />

    <httpHandlers />

    <membership defaultProvider="MySqlMembershipProvider">

      <providers>

        <clear/>

        <remove name="MySqlMembershipProvider"/>

        <add name="MySQLMembershipProvider" autogenerateschema="true" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />

      </providers>

    </membership>

    <profile>

      <providers>

        <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />

      </providers>

    </profile>

    <roleManager defaultProvider="MySqlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" >

      <providers>

        <clear />

        <add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider,MySql.Web, Version=5.2.2.0, Culture=neutral,PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" writeExceptionsToEventLog="false" />

      </providers>

    </roleManager>

  </system.web>

Open in new window

0
Comment
Question by:tk6077
  • 2
4 Comments
 
LVL 15

Expert Comment

by:deepaknet
Comment Utility
There is a good wrapper here http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx

Can you check out?
0
 

Author Comment

by:tk6077
Comment Utility
Unfortunately I've had no luck getting this class set to work. Its the second link I've provided in my referenced tutorials section. I understand the concept in this tutorial however it doesn't work for me. I am using MySQL v.4 which the author of that tutorial stated has problems loading the schema. So I have set up my own tables in accordance with the format layed out in the SQL statements to no avail.
0
 

Accepted Solution

by:
tk6077 earned 0 total points
Comment Utility
I gave up trying to get the built in DotNet controls to work and just made my own. It would be nice to use them I just don't have the kind of time required to keep messing with it.
0
 

Expert Comment

by:manitou2215
Comment Utility
If you ever have time to research this again, the following video series / associated tutorials really helped get me started with asp.net membership:

www.asp.net/learn/security-videos/

0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now