none
Undefined Imports System.Data.mysqlclient RRS feed

  • Question

  • Hi Pals! Please assist. I cant troubleshoot this issue. I already download mysql connector but the Imports System.Data.MysqlClient is still undefined. Here's my code:

    Imports System.Data.mysqlclient

    Public Class login

        Private Sub btnlogin_Click(sender As Object, e As EventArgs) Handles btnlogin.Click
            Dim conn As New mySqlConnection
            Dim cmd As New mySqlCommand
            conn.ConnectionString = "Server=localhost; user id=root; password=; database=mydb;"
            cmd.Connection = conn
            conn.Open()
            Me.Hide()
            page1.Show()

        End Sub
    End Class

    And I already have mysql.data on my project references. Cant find the mysql.data.dll

    

    Monday, July 2, 2018 4:51 PM

Answers

  • Hi mitchieee,

    It will be worked if you add reference MySql.Data.MySqlClient to your project. if you Imports System.Data.MySQLclient, you can avoid to write MySql.Data.MySqlClient in your application.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by mitchieee Tuesday, July 3, 2018 3:09 PM
    Tuesday, July 3, 2018 1:08 AM
    Moderator

All replies

  • I think its working without Imports System.Data.MySQLclient..

    I used this:

    Dim conn As New MySql.Data.MySqlClient.MySqlConnection
    Dim cmd As New MySql.Data.MySqlClient.MySqlCommand

    But I would love to here your suggestions ;)

    Monday, July 2, 2018 5:47 PM
  • Hi mitchieee,

    It will be worked if you add reference MySql.Data.MySqlClient to your project. if you Imports System.Data.MySQLclient, you can avoid to write MySql.Data.MySqlClient in your application.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by mitchieee Tuesday, July 3, 2018 3:09 PM
    Tuesday, July 3, 2018 1:08 AM
    Moderator
  • Its working now! I used Imports MySql.Data.MySqlClient 

    Thanks!

    Tuesday, July 3, 2018 3:12 PM