Results 1 to 4 of 4

Thread: How to connect VB.NET to MySQL database?

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Location
    Klang, Selangor, Malaysia
    Posts
    163

    Question How to connect VB.NET to MySQL database?

    I'm trying to connect my VB.NET project to MySQL Database. I used ODBCDataAdapter and ODBCConnect, but failed.
    Actually I can successfully connect to MySQL Database in VB 6.0 last time using ODBC.
    How can I make it in VB.NET?
    Please guide, thank you!

  2. #2
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    When I Connected my SQLserver database I just Added a connection in the "Server Explorer".
    Checked that ole db pro.... sql server was setted
    checked for the database, name, password
    then ok

    I did almost same with my MS Access database. Only difference is that I chooced MS Jet 4.0 ole db provider

    After that.
    Added a dataadapter (dbconnection is created also) and select what info you want
    and then right click on your dataadapter and generate a dataset and you should got what you want

    Not sure if the info is what you wanted but hopefully it can help some.
    //Martin Andersson

  3. #3
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    To connect via ODBC you'll need the driver: http://www.mysql.com/products/myodbc/index.html

    I'm not sure if there's a way to connect via OLEDB.
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  4. #4
    New Member
    Join Date
    Aug 2003
    Posts
    2
    www.planetsourcecode.com has an example up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width