Connecting to mysql

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?
 
K

Ken Tucker [MVP]

Hi,

Framework version 10 use Imports Microsoft.Data.Odbc

Framework version 1.1 use Imports System.Data.Odbc

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top