Connecting to mysql

  • Thread starter Thread starter s5034454
  • Start date Start date
S

s5034454

Hello, I'm trying to connect to a mysql database. I have already
taken these steps:
1) downloaded and installed odbc_net.msi
2) downloaded and installed mdac_typ.exe (mdac 2.7 or something)
3) written this code:

Imports System.Data.Odbc.OdbcConnection

Public Class Test
Inherits System.Windows.Forms.Form

+ windows form designer generated code

Private Sub Test_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51
Driver};" & _
"SERVER=db.pcextreme.nl;" & _
"DATABASE=test;" & _
"UID=root;" & _
"PASSWORD=pass;" & _
"OPTION=3"
Dim MyConnection As New
System.Data.Odbc.OdbcConnection(MyConString)

MyConnection.Open()
End Sub
End Class

But VB.NET doesn't recognize the namespace and I can't find it in the
"add reference" list. Could anyone help me?
 
Hi,

Framework version 10 use Imports Microsoft.Data.Odbc

Framework version 1.1 use Imports System.Data.Odbc

Ken
 
Back
Top