Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

Last post 05-21-2009 10:33 PM by alfalpha. 17 replies.

Sort Posts:

  • Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    06-03-2008, 1:18 PM
    • Member
      11 point Member
    • deap82
    • Member since 12-04-2007, 12:25 PM
    • Stockholm
    • Posts 27

    Hello,
    Im having problems with using the MySql Connector/Net version 5.2.2 downloaded from http://dev.mysql.com/downloads/connector/net/5.2.html

    After installation I have followed the instructions from this blogpost; http://blog.nolanbailey.com/2008/03/08/mysql-aspnet-membership-and-role-provider/194

    But when I'm done with the last bullet in that list of instructions I turn to the security tab of the Asp.Net Configuration tool, and the following error message appears (text and screenshot below). I also have tried to go on with selecting the MySql Role Provider as well as going on with entering the membership and role-section in my web.config as the above blogpost suggests. But that doesn't help and when I look in the database no tables has been added.

    I'm using Visual Studio 2008 and the website I've been experimenting with is for the 3.5 Framework.

    Any help is greatly appreciated.

    Error Message:
    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. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 146)

    Screenshot:

     

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    06-03-2008, 6:55 PM
    • Member
      268 point Member
    • visliCom
    • Member since 05-01-2008, 4:57 PM
    • Posts 226

    copy MySql.Data.dll file in your bin folder and try again.

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    06-04-2008, 8:47 AM
    • Participant
      1,304 point Participant
    • CLIPER
    • Member since 07-18-2004, 9:54 AM
    • Philippines
    • Posts 379

    First, mysql connector.net 5.2.2 beta will not register correctly to .net 3.5. I tested it.

    Did you happen to backup your machine.config? There are workaround of this problem. Try to search the mysql forum. Discussions are sticky.


    Regards,

     

    CLIPER
     

    ------------------------------------------------
    Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own commonsense. ---Buddha (563BC-483BC)
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    06-04-2008, 1:05 PM
    • Member
      11 point Member
    • deap82
    • Member since 12-04-2007, 12:25 PM
    • Stockholm
    • Posts 27

     visliCom: This doesn't seem to help. Do I need to do it in any particular order?

     Cliper: Oh I see... Well, wont machine.config be restored if I uninstall the mysql connector? Or do you mean that I shoudl have the connector installed but with machine.config unchanged? I didn't make a backup but I have never made any changes to machine.config before and I noticed there is a machine.config.default-file, could that file be used to make a rollback? I just now compared the files with WinDiff and there seems to be some other diffences, so maybe I could just delete the mysql-related stuff? I'll have another go at the myqsl forum...
     

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    09-09-2008, 5:24 AM
    • Member
      21 point Member
    • x-freestyler
    • Member since 04-12-2008, 1:24 PM
    • Turkey
    • Posts 10

     You have to insert autogenerateschema=”true” attribute to the machine.config.

    <membership>
    <providers>
    <add name=”MySQLMembershipProvider” autogenerateschema=”true” type=”MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, … />
    </providers>
    </membership>

     

    I solved my problems with MySQL Membership.You could read this post.

    |innovacube blog

    Mark replies as answers if they helped you solve the problem.
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    09-12-2008, 4:50 PM
    • Member
      24 point Member
    • narengokal
    • Member since 07-30-2008, 12:50 PM
    • Posts 30

    If u have just started .. i suggest u just re-install .. I have had too many problems and it takes too long to try and figure out what the problem is.

    Just re-install mysql .. and configure the machine.config appropriately using nolanblog and the web.config as well.

    Make sure u use all that the blog says ... Mine works fine.

    Dont forget to also install the ODBC driver for mysql to access the database via C# or VB ..whichever u using

     

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 2:28 AM
    • Member
      10 point Member
    • shahg
    • Member since 10-04-2008, 6:03 AM
    • Karachi
    • Posts 5

    Hi guys,

    I've tried everything that people are advising and still nothing. When I run the ASP.NET configuration I get "An error was encountered. Please return to the previous page and try again."

    So, I tried connecting to MySQL from code and I was successful with ODBC (OdbcConnection) using a System DSN only.

    I've done the following:

    • Installed Connector Net 5.2.2
    • Have both Mysql.Data and Mysql.web in bin folder (well this didn't do any good as i had to add reference anyway to compile the code.)
    • Added autogenerateschema="true" to machine.config
    • Added connection string to web.config
      • connectionString="server=localhost; user id=root; password=polo; persist security info=true; database=membership;" providerName="MySql.Data.MySqlClient"

    I wanted to ask what version of Mysql are you guys using? I'm using 6 and I suspect there is something with Mysql 6. Anyone tried that with Mysql 6? And is it possible to use anything other than connector net for membership?

     Thnaks

     ShahG

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 3:16 AM
    • Member
      10 point Member
    • shahg
    • Member since 10-04-2008, 6:03 AM
    • Karachi
    • Posts 5

     Can anyone post the MySql dump of membership tables so we, who are having problems, can use odbc to get working? Smile

  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 8:06 AM
    • Member
      21 point Member
    • x-freestyler
    • Member since 04-12-2008, 1:24 PM
    • Turkey
    • Posts 10

    I'm using MySQL 6. Also check http://forums.asp.net/t/1090491.aspx for the error.

     -- MySQL Administrator dump 1.4
    --
    -- ------------------------------------------------------
    -- Server version    6.0.6-alpha-community


    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


    --
    -- Create schema dorknozzle
    --

    CREATE DATABASE IF NOT EXISTS dorknozzle;
    USE dorknozzle;

    --
    -- Definition of table `my_aspnet_applications`
    --

    DROP TABLE IF EXISTS `my_aspnet_applications`;
    CREATE TABLE `my_aspnet_applications` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(256) DEFAULT NULL,
      `description` varchar(256) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

    --
    -- Dumping data for table `my_aspnet_applications`
    --

    /*!40000 ALTER TABLE `my_aspnet_applications` DISABLE KEYS */;
    INSERT INTO `my_aspnet_applications` (`id`,`name`,`description`) VALUES
     (1,'/','MySQL Role provider');
    /*!40000 ALTER TABLE `my_aspnet_applications` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_membership`
    --

    DROP TABLE IF EXISTS `my_aspnet_membership`;
    CREATE TABLE `my_aspnet_membership` (
      `userId` int(11) NOT NULL DEFAULT '0',
      `Email` varchar(128) DEFAULT NULL,
      `Comment` varchar(255) DEFAULT NULL,
      `Password` varchar(128) NOT NULL,
      `PasswordKey` char(32) DEFAULT NULL,
      `PasswordFormat` tinyint(4) DEFAULT NULL,
      `PasswordQuestion` varchar(255) DEFAULT NULL,
      `PasswordAnswer` varchar(255) DEFAULT NULL,
      `IsApproved` tinyint(1) DEFAULT NULL,
      `LastActivityDate` datetime DEFAULT NULL,
      `LastLoginDate` datetime DEFAULT NULL,
      `LastPasswordChangedDate` datetime DEFAULT NULL,
      `CreationDate` datetime DEFAULT NULL,
      `IsLockedOut` tinyint(1) DEFAULT NULL,
      `LastLockedOutDate` datetime DEFAULT NULL,
      `FailedPasswordAttemptCount` int(10) unsigned DEFAULT NULL,
      `FailedPasswordAttemptWindowStart` datetime DEFAULT NULL,
      `FailedPasswordAnswerAttemptCount` int(10) unsigned DEFAULT NULL,
      `FailedPasswordAnswerAttemptWindowStart` datetime DEFAULT NULL,
      PRIMARY KEY (`userId`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='2';

    --
    -- Dumping data for table `my_aspnet_membership`
    --

    /*!40000 ALTER TABLE `my_aspnet_membership` DISABLE KEYS */;
    INSERT INTO `my_aspnet_membership` (`userId`,`Email`,`Comment`,`Password`,`PasswordKey`,`PasswordFormat`,`PasswordQuestion`,`PasswordAnswer`,`IsApproved`,`LastActivityDate`,`LastLoginDate`,`LastPasswordChangedDate`,`CreationDate`,`IsLockedOut`,`LastLockedOutDate`,`FailedPasswordAttemptCount`,`FailedPasswordAttemptWindowStart`,`FailedPasswordAnswerAttemptCount`,`FailedPasswordAnswerAttemptWindowStart`) VALUES
     (1,'xspgroup@gmail.com','','bTtqDvf321Z0kPDj1WM6l2MAdd4=','0u5tmP68bDcOPlOBDEQj5g==',1,'Where were you born?','PPboVQR/Uh4KGr8BAuu3gDNHT6M=',1,'2008-09-12 18:42:46','2008-09-12 18:42:46','2008-09-09 00:48:10','2008-09-09 00:48:10',0,'2008-09-09 00:48:10',0,'2008-09-09 00:48:10',0,'2008-09-09 00:48:10'),
     (2,'xfreestyler@gmail.com','','6fwl7jHLhq5cUVffUcuBbzXbauo=','NdfIQNQqHx0+VMG+9yzpFQ==',1,'Where were you born?','IO5aDY+tTadkxw8IHLBWCY+WT0E=',1,'2008-09-12 17:26:19','2008-09-12 17:26:19','2008-09-09 01:01:06','2008-09-09 01:01:06',0,'2008-09-09 01:01:06',0,'2008-09-09 01:01:06',0,'2008-09-09 01:01:06');
    /*!40000 ALTER TABLE `my_aspnet_membership` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_profiles`
    --

    DROP TABLE IF EXISTS `my_aspnet_profiles`;
    CREATE TABLE `my_aspnet_profiles` (
      `userId` int(11) NOT NULL,
      `valueindex` longtext,
      `stringdata` longtext,
      `binarydata` longblob,
      `lastUpdatedDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
      PRIMARY KEY (`userId`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    --
    -- Dumping data for table `my_aspnet_profiles`
    --

    /*!40000 ALTER TABLE `my_aspnet_profiles` DISABLE KEYS */;
    /*!40000 ALTER TABLE `my_aspnet_profiles` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_roles`
    --

    DROP TABLE IF EXISTS `my_aspnet_roles`;
    CREATE TABLE `my_aspnet_roles` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `applicationId` int(11) NOT NULL,
      `name` varchar(255) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

    --
    -- Dumping data for table `my_aspnet_roles`
    --

    /*!40000 ALTER TABLE `my_aspnet_roles` DISABLE KEYS */;
    INSERT INTO `my_aspnet_roles` (`id`,`applicationId`,`name`) VALUES
     (1,1,'Users'),
     (2,1,'Administrators');
    /*!40000 ALTER TABLE `my_aspnet_roles` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_schemaversion`
    --

    DROP TABLE IF EXISTS `my_aspnet_schemaversion`;
    CREATE TABLE `my_aspnet_schemaversion` (
      `version` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    --
    -- Dumping data for table `my_aspnet_schemaversion`
    --

    /*!40000 ALTER TABLE `my_aspnet_schemaversion` DISABLE KEYS */;
    INSERT INTO `my_aspnet_schemaversion` (`version`) VALUES
     (3);
    /*!40000 ALTER TABLE `my_aspnet_schemaversion` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_users`
    --

    DROP TABLE IF EXISTS `my_aspnet_users`;
    CREATE TABLE `my_aspnet_users` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `applicationId` int(11) NOT NULL,
      `name` varchar(256) NOT NULL,
      `isAnonymous` tinyint(1) NOT NULL DEFAULT '1',
      `lastActivityDate` datetime DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

    --
    -- Dumping data for table `my_aspnet_users`
    --

    /*!40000 ALTER TABLE `my_aspnet_users` DISABLE KEYS */;
    INSERT INTO `my_aspnet_users` (`id`,`applicationId`,`name`,`isAnonymous`,`lastActivityDate`) VALUES
     (1,1,'root',0,'2008-09-12 18:42:46'),
     (2,1,'hasan',0,'2008-09-12 17:26:19');
    /*!40000 ALTER TABLE `my_aspnet_users` ENABLE KEYS */;


    --
    -- Definition of table `my_aspnet_usersinroles`
    --

    DROP TABLE IF EXISTS `my_aspnet_usersinroles`;
    CREATE TABLE `my_aspnet_usersinroles` (
      `userId` int(11) NOT NULL DEFAULT '0',
      `roleId` int(11) NOT NULL DEFAULT '0',
      PRIMARY KEY (`userId`,`roleId`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

    --
    -- Dumping data for table `my_aspnet_usersinroles`
    --

    /*!40000 ALTER TABLE `my_aspnet_usersinroles` DISABLE KEYS */;
    INSERT INTO `my_aspnet_usersinroles` (`userId`,`roleId`) VALUES
     (1,2),
     (2,1);
    /*!40000 ALTER TABLE `my_aspnet_usersinroles` ENABLE KEYS */;




    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

    |innovacube blog

    Mark replies as answers if they helped you solve the problem.
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 9:30 AM
    • Member
      10 point Member
    • shahg
    • Member since 10-04-2008, 6:03 AM
    • Karachi
    • Posts 5

     Thanks for the dump. I created the table and still no progress. Then I tried to create a data connection from server explorer and when i chose mysql provider visual studio crashed. So I re-installed connector net 5.2.2 and it was done. I am able to navigate and see the data from mysql database in server explorer.

    I placed a gridview on my page and attached it to the newly created data connection and i was greeted with the same exception:

      

    [SocketException (0x273d): The attempted operation is not supported for the type of object referenced]
       System.Net.Sockets.Socket.get_ConnectEx() +293
       System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state) +397
       System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state) +181
       MySql.Data.Common.StreamCreator.CreateSocketStream(IPAddress ip, Boolean unix) +216
       MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) +481
       MySql.Data.MySqlClient.NativeDriver.Open() +406
    
    [MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
       MySql.Data.MySqlClient.NativeDriver.Open() +549
       MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +69
       MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +29
       MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +110
       MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +174
       MySql.Data.MySqlClient.MySqlPool.GetConnection() +118
       MySql.Data.MySqlClient.MySqlConnection.Open() +527
     How come i can see the data from server explorer using connector net 5.2.2 and not from code? I also tried with 5.2.3 and still nothing. Crying
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 9:58 AM
    • Member
      21 point Member
    • x-freestyler
    • Member since 04-12-2008, 1:24 PM
    • Turkey
    • Posts 10

    Have you read the instructions at: http://www.innovacube.com/Post/13/Asp-Net-Authorization-Authentication-with-MySQL.aspx I've successfully connected my project to MySQL.

    |innovacube blog

    Mark replies as answers if they helped you solve the problem.
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 11:26 AM
    • Member
      10 point Member
    • shahg
    • Member since 10-04-2008, 6:03 AM
    • Karachi
    • Posts 5

     yes i have read the article and tried all to no use Sad. i had "c#" in the application path that i removed and now the ASP.NET configuration tool is running. but still Unable to initialize provider. Missing or incorrect schema. (E:\CSharp\Google\Google\web.config line 44)

    Line 44 is  <add name="MySQLMembershipProvider" .......
    <membership defaultProvider="MySQLMembershipProvider">
    <providers>
    <remove name="MySQLMembershipProvider"/>
    <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, Culture=Neutral, PublicKeyToken=c5687fc88969c44d"
    connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false"
    applicationName="/Google" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="3"
    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" autogenerateschema="true"/>
    </providers>
    </membership>
     Well, this isn't the problem cause i can always work with code to manage security BUT the code also gives the exception i mentioned earlier. Here is my code:
    MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["LocalMySqlServer"].ToString());            
    con.Open();
    i checked the connection string its Datasource=localhost;Database=membership;uid=root;pwd=polo;
    Anything? anyone? Crying 
     
     
     
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-04-2008, 12:07 PM
    • Member
      21 point Member
    • x-freestyler
    • Member since 04-12-2008, 1:24 PM
    • Turkey
    • Posts 10

     My web.config file is :

        <connectionStrings>
            <add name="Dorknozzle" connectionString="server=localhost; user id=root; password=toor; database=dorknozzle; pooling=false;"/>
            <add name="DorknozzleConnectionString" connectionString="server=localhost; user id=root; password=toor; persist security info=true; database=dorknozzle;" providerName="MySql.Data.MySqlClient"/>
            <remove name="LocalMySqlServer"/>
            <add name="LocalMySqlServer" connectionString="server=localhost; user id=root; password=toor; persist security info=true; database=dorknozzle;" providerName="MySql.Data.MySqlClient"/>
        </connectionStrings>
        <system.web>
            <authorization>
       <deny users="?" />
      </authorization>
      <roleManager enabled="true" defaultProvider="MySQLRoleProvider" />
        <membership defaultProvider="MySQLMembershipProvider">
           <providers>
              <remove name="MySQLMembershipProvider" />
              <add autogenerateschema="true" connectionStringName="LocalMySqlServer"
                 enablePasswordRetrieval="false" enablePasswordReset="true"
                 requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false"
                 passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="5"
                 minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                 passwordStrengthRegularExpression="" name="MySQLMembershipProvider"
                 type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
           </providers>
        </membership>
            <customErrors mode="RemoteOnly"/>

    |innovacube blog

    Mark replies as answers if they helped you solve the problem.
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-05-2008, 6:17 PM
    • Member
      251 point Member
    • palmerm1
    • Member since 08-08-2007, 12:12 PM
    • Nashville, TN
    • Posts 94

     I don't know if this will help or not.  I relate to your frustration.  I fought and fought with this before I finally got it working on my application a couple months ago.  I don't have any experience using MySql 6.  I've been using 5 and was able to get the Membership thing going pretty reliably with connector v 5.2.3.  I am using VS 2008 as you are.  I am wondering a couple of things:

    a) Are you sure your connection string is working?  It sounds like you have tested this with an odbc connection and proven that it does work.  I don't ever work with odbc, so I don't know whether this matters.  I generally use either a sqldatasource on my page like this:

    <asp:SqlDataSource ID="SqlDataSourceQuestions" runat="server"             
    ConnectionString="<%$ ConnectionStrings:currentCS %>"
    ProviderName="<%$ ConnectionStrings:currentCS.ProviderName %>"
    SelectCommand="SELECT q.`question_id`,
    concat(m.`medication_name`, ' for ', c.`case_name`) as CaseDesc
    FROM `cases` c,
    `medications` m,
    `questions` q
    WHERE q.case_id=c.case_id
    AND q.medication_id=m.medication_id
    ORDER BY c.`case_name`, m.`medication_name`"
    ></asp:SqlDataSource>

     
    Or in code-behind like this:

    string StrSql = "select * from mytable";
    // contains the connection string from web.config
    string pSqlConnString = System.Configuration.ConfigurationManager.ConnectionStrings["currentCS"].ToString(); 
    MySqlDataAdapter pDataAdapter;
    MySqlConnection myConnection = new MySqlConnection(pSqlConnString);
    pDataAdapter = new MySqlDataAdapter(StrSql, myConnection);
    pDataAdapter.Fill(pDataSet, "mytable");

    I would want to know for certain that my connection string does work independent of the membership schema.  That way, I've eliminated that as a possible explanation of the problem.

    b) If you are certain that the connection works, then I would suspect the problem is with the schema.  I had trouble last month getting the errors you are getting.  I had gotten the tables all setup, but I either had gotten some errors back from MySQL server when the tables setup OR I was having trouble with the table names being all lower case while the .NET Connector Membership provider was looking for table names with capital letters in them.  

    I wrote up an article on my blog about how I have been able to get Membership up and running with the v5.2.3 connector and MySql 5.  It's located here:

     http://www.marvinpalmer.com/MarvinPalmer/post/Implement-NET-Membership-and-Roles-using-MySql-Connector-523-on-GoDaddy.aspx

    Good luck, man.  

    Marvin

    If, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don't pull that off very often. ;-)
  • Re: Can't get MySQL Connector/Net 5.2.2 to work (with Membership)

    10-08-2008, 12:21 AM
    • Member
      10 point Member
    • shahg
    • Member since 10-04-2008, 6:03 AM
    • Karachi
    • Posts 5

    Hi Marvin,

    Thanks for the info! I was able to make it work on my office pc, but on my home pc it just won't work. After spending more than a week on this issue I came to the conclusion of using both MySQL and MSSQL with my website. MSSQL for membership, profiles and session state storage and for normal site data and full text search MySQL via good old ODBC (MSSQL with full text is expensive, and Tech support asked for one time $20 for installation of Connector/Net on my request).

    Regards

    Shahid

Page 1 of 2 (18 items) 1 2 Next >