Click here to Skip to main content
14,365,424 members

.NET MySQL Connexion V 1.2

Rate this:
3.25 (12 votes)
Please Sign up or sign in to vote.
3.25 (12 votes)
17 Jul 2003
Class Library for MySQL request


This is a class library in VB.NET made for access on MySQL databases. You can use this library without creating functions for working on the databases.

For using this library, you must install :

and the

In this library, you have 3 classes:

  • ManipStringForMySQL: This class modifies the string for the SGBD
  • MySQL_Requettes: This class makes the request on the SGBD
  • MySQL_Utils : This class makes tests on the data of the SGBD

Visual Studio project screenshot

An example of the function with a dataset holding the results of the query:

Public Shared Function MyODBCDataset(ByVal ReqSQL As String, _
         ByVal LaBase As String, ByVal Server As String, _
         ByVal Password As String, ByVal User As String, _
         ByVal NomDataSet As String) As DataSet
    ' Connexion à un server MySQL 
    'avec le Driver ODBC 3.51 avec requette qui renvoie un dataset
    Dim MyConString As String = _
        "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & Server _
        & ";DATABASE=" & LaBase & ";UID=" & User _
        & ";PASSWORD=" & Password & ";OPTION=3;"

    Dim MyODBCConnexion As New OdbcConnection(MyConString)
        Dim ds As New DataSet()
        Dim cmd As OdbcDataAdapter = New 
        OdbcDataAdapter(ReqSQL, MyConString)
        Dim MyCommand As New OdbcCommand()
        Dim MyDataReader As OdbcDataReader
        cmd.Fill(ds, NomDataSet)
        Return ds
    Catch MyOdbcException As OdbcException
    Catch MyException As Exception
    End Try
End Function

The call of this function may be like that:

Dim MonDatasetTemp As DataSet = MySQL_Requettes.MyODBCDataset(


This library is the first example I made for the MySQL use in my ASP.NET solutions. I hope it can be easy for use in your projects.

You can also see the French version of this article more directed for the creation and use of the class library :


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Romelard Fabrice (Alias F___)
Web Developer
Switzerland Switzerland
I'm French Web developer and MVP.
My favorites languages are ASP.NET and SharePoint. I made a lot of projects in open source and many articles.
You can see all my articles on french developer sites like :
- http:/

My technical blog is in French community :

Romelard Fabrice [MVP]

Comments and Discussions

GeneralThe trust relationship between this workstation and the primary domain failed. Pin
Mind Experts27-Jun-06 13:59
memberMind Experts27-Jun-06 13:59 
Generalerror 403 !!! Pin
Lil`Buh16-Feb-04 2:23
memberLil`Buh16-Feb-04 2:23 
GeneralNot Support Authendication Pin
Anonymous18-Jan-04 23:12
memberAnonymous18-Jan-04 23:12 
GeneralRe: Not Support Authendication Pin
Nazz225-Nov-08 2:59
memberNazz225-Nov-08 2:59 
Generalnice work Pin
Anonymous16-Jan-04 5:28
memberAnonymous16-Jan-04 5:28 
QuestionWhat? Pin
dog_spawn18-Jul-03 6:02
memberdog_spawn18-Jul-03 6:02 
AnswerRe: What? Pin
Juergen Posny18-Jul-03 6:05
memberJuergen Posny18-Jul-03 6:05 
Generaler ok Pin
dog_spawn18-Jul-03 6:15
memberdog_spawn18-Jul-03 6:15 
GeneralRe: er ok Pin
Romelard Fabrice (Alias F___)18-Jul-03 6:44
memberRomelard Fabrice (Alias F___)18-Jul-03 6:44 
GeneralAh, pilote = driver Pin
dog_spawn18-Jul-03 6:59
memberdog_spawn18-Jul-03 6:59 
GeneralRe: Ah, pilote = driver Pin
Nix_24-Aug-03 11:19
memberNix_24-Aug-03 11:19 
GeneralAlready said Pin
dog_spawn24-Aug-03 11:41
memberdog_spawn24-Aug-03 11:41 
GeneralRe: Already said Pin
Nix_30-Aug-03 10:43
memberNix_30-Aug-03 10:43 
Answerhow ? Pin
denise83840529-Aug-04 17:12
memberdenise83840529-Aug-04 17:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 17 Jul 2003


37 bookmarked