Data Platform Developer Center > Data Platform Development Forums > ADO.NET Data Providers > Does Visual Basic 2008 Support MySql Connection?
Ask a questionAsk a question
 

AnswerDoes Visual Basic 2008 Support MySql Connection?

Answers

  • Thursday, March 20, 2008 11:39 AMPaul P Clement IVMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Yes, but you can't use the designers because they don't support the MySQL providers or drivers. You would have to write ADO.NET code instead.

All Replies

  • Wednesday, March 19, 2008 6:44 PMJaime Aviles Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    The question is, if visual basic 2008 express edition support mysql.

     

    so far i know, there is a plug in for vs 2008 but not for 2008 express edition

  • Thursday, March 20, 2008 11:39 AMPaul P Clement IVMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Yes, but you can't use the designers because they don't support the MySQL providers or drivers. You would have to write ADO.NET code instead.
  • Thursday, May 08, 2008 5:45 AMprimejohnz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I've tested it with VB 2008 Express Edition.

     

    Install this connector http://dev.mysql.com/downloads/connector/net/5.2.html

    on your project add a reference to MySQL.Data

     

    Connection String:

    "Data Source=myServer;Database=myDB;User ID=myUser;Password=myPass"

     

    MySQL Connection:

    MySql.Data.MySqlClient.MySqlConnection

     

    MySQL Command:

    MySql.Data.MySqlClient.MySqlCommand

     

    it worked on me.

     

  • Thursday, May 14, 2009 1:41 AMMichael Grumbach Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There are three downloads on this page.
    Which one?

    And I'm writting a visual basic application using a remote MySQL dB.
    I'm learning little pieces here and there.
    Is there someplace to understand the big picture for nubies and where to go from there?

    Thanks,
    Mike
  • Tuesday, August 11, 2009 11:56 AMjpk5930 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yes, but you can't use the designers because they don't support the MySQL providers or drivers. You would have to write ADO.NET code instead.
    Help me undertsand your answer in relation to primjohnz's response.  He is able to use the mysql reference in his code, then connect using connector/net.  Are you saying something different with your mention of havingt o write ado.net code?  I apologize for not understanding all the vernacular yet :)

    I'm currently using vb.net and mysql and wondering if I'll have to learn ado.net code(?) if I switch over to visual basic 2008 express?

    Thank you,
    Jim
  • Thursday, November 05, 2009 4:22 AMRIAB Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    but if i want connect a DB of mysql using a dataset typed?
    how do you do?
  • Thursday, November 05, 2009 3:23 PMPaul P Clement IVMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    See if the following helps:

    http://forums.mysql.com/read.php?38,63017,63123


    Paul ~~~~ Microsoft MVP (Visual Basic)
  • Thursday, November 12, 2009 5:06 AMACCOUNTINGONLINE.US Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Try this using your own mysql database


    Imports

     

    MySql.Data.MySqlClient

     

    Public

     

    Class A_Test_Form_MySql

     

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     

    Dim conn = New MySqlConnection()

    conn.ConnectionString =

    "server=" & txtServer.Text & ";" _

    &

    "user id=" & txtUsername.Text & ";" _

    &

    "password=" & txtPassWord.Text & ";" _

    &

    "database=northwind"

     

    Try

    conn.Open()

    MessageBox.Show(

    "Connection Opened Successfully")

    conn.Close()

     

    Catch myerror As MySqlException

    MessageBox.Show(

    "Error Connecting to Database: " & myerror.Message)

     

    Finally

    conn.Dispose()

     

    End Try

     

     

    End Sub

    End

     

    Class

    F. Pena
    www.AOScorporation.com


    FPENA