Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
How to Connect to mysql (Wednesday, November 24, 2004)
 

Found the following interesting discussion in the Newsgroups:

Connecting to mysql
by:dennis.claes@skynet-dot-be.no-spam.invalid (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?



 Reply:
by:Ken Tucker [MVP]

 Hi,

Framework version 10 use Imports Microsoft.Data.Odbc

Framework version 1.1 use Imports System.Data.Odbc

Ken


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
<URL:http://www.connectionstrings.com/>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders



 
Previous Posts
    - How to populate a listbox
    - Decimal To Binary Function Does Not Work
    - How to Run a batch file by passing parameters with...
    - WTSAPI32 Dll entry point missing for WTSSendMessag...
    - winmm.dll
    - How to play sounds that don't exist.
    - How to Execute a method in one form from another
    - How to inherit an attribute with the class it appl...
    - How to create a setup wizard
    - How to get Raw TCP in VB.net form from IIS

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland