Cannot get to MySQL from ASP.NET RRS feed

  • Question

  • User-828129426 posted

    I usually use ASP.NET with a MS SQL Server but need to set up this site using MySQL instead.  I have MySQL installed and running, created a database and user so all of that is set.

    I've downloade the mysql-connector-net-5.2.7-noinstall provider from the MySQL web site.  I've had to downgrade the MySQL provider because it was saying that it was (in essence) too new to use and that error dissappeared once I replaced it with 5.2.7.

    I've added MySQLData.dll to my /bin directory

    I've added

    <%@ import Namespace="MySql.Data.MySqlClient" %> 


    I cannot add "using MySQL.Data;" because the "type or namespace cannot be found."

    I've tried adding a reference to the .dll in my /bin directory but that doesn't change anything.

    What am I missing?  I would rather use the .dll in the /bin directory and not have anything machine-specific installed (e.g. GAC).

    It probably doesn't help either that I am experienced with VB.NET and for this project I am working in C#.


    Friday, April 15, 2011 1:24 PM

All replies

  • User-718146471 posted

    So let me see if I understand your situation. You want to use the MySQL Connector 5.2.7. You've created a reference in your code and it is saying that it can't find the namespace? Have you considered trying this as

    Using MySQL.Data;

    in your code-behind page? Once you do that, the MySQL namespace should be available to you.

    Friday, April 15, 2011 2:16 PM
  • User-718146471 posted

    I'm thinking though because 6.3 is fully integrated into VS, it may be worth your while to use it instead of 5.2.7 since I've had trouble with that connector before. Take a look at this: http://dev.mysql.com/doc/refman/5.1/en/connector-net-visual-studio.html

    Friday, April 15, 2011 2:19 PM
  • User-828129426 posted

    Already tried adding "using MySQL.Data;"

    I cannot add "using MySQL.Data;" because the "type or namespace cannot be found."

    Friday, April 15, 2011 4:05 PM
  • User-718146471 posted

    Let me see what I can figure out for you and I'll get back to you.

    Monday, April 18, 2011 8:53 AM
  • User-718146471 posted

    Dragonbite, check your inbox here.

    Monday, April 18, 2011 9:22 AM
  • User-718146471 posted

    Dragonbite will have to post it since it is his code and data, not mine.

    Friday, August 19, 2011 7:07 AM
  • User-718146471 posted

    I remember why now. The board here doesn't permit file attachments so for him to get the solution I built, I had to email it to him. I'll see about putting it into a dropbox somewhere and then share the link that way.

    Friday, August 19, 2011 7:23 AM