asp.net connecting to MySQL possible?

Discussion in 'Databases' started by showmanagerEU, Mar 10, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    on my other website hosted by m6.net I use the combination asp.net and mysql with the ODBC-driver and its work very well.
    I want to have the same configuration here and I ordered the MySQL-Addon.
    Now I have the problem to find out how I can realize the connection between asp.net and MySQL. I don't find the ODBC-Driver.
    Can anybody give me a tip or is that not possible to use MySQL with asp.net here?

    Thank you

    Alex
     
  2. You should be able to connect using the MySQL Connector, as shown in this other thread:
    http://community.discountasp.net/showthread.php?t=11948

    While they're talking about RIA services, you shouldn't have any problems connecting.

    I'd recommend using the MySQL Connector over the ODBC, as it's better technology.
     
  3. Thanks Jose,

    for the information.
    I also want to use the MySQL Connector over the ODBC.
    I found in the knowledge database an code example: Knowledge Base

    with the follow code sequenz:

    Dim myConnection As New OdbcConnection("DSN=<username>_mysqlConn")

    I want to define in my web.config the connectionstring but I can't use "<username>_mysqlConn" there. I try all my known usernames instead of <username>. Nothing help. I always get the message: "ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

    Can anybody give me a tip how I can find out my correct connectionstring for ODBC?

    Thank you very much.

    Alex
     
  4. Hello Jose,

    thank you for the information.

    In the Knowledge Base I found an code example using ODBC with asp.net: Code Example

    Now my problem is, I don't know the correct setting for the connectionstring in web.config.
    In the code example there is a placeholder:
    Dim myConnection As New OdbcConnection("DSN=<username>_mysqlConn")

    But the placeholder <username> I can not use this in web.config?

    How can I find out the correct connectionString for the web.config

    Can anybody give me a tip?

    Thank you.

    Alex
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    are you using asp or asp.net?
     
  6. I use asp.net 3.5.

    Alex
     
  7. Bruce

    Bruce DiscountASP.NET Staff

    The sample code you found is applicable only for our old MySQL offering (mySQL 3.5)

    We no longer create ODBC DSN for mySQL 5.x.

    With MySQL 5, you'll have to stick w/ mySQL .NET connector. I can post sample code if you need help.
     
  8. ODBC Driver V6.0 to create DSN to a MySQL 5.x database:
    docs.openlinksw.com/virtuoso/qsvdbsrv.html
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page