mysql| Data | Database
This is a library of classes written in vb.net for connecting to MySQL. You can use this class library to manipulate the MySQL database directly.
Before using this class library, you must install the
ODBC MYSQL 3.51 download Address: http://www.mysql.com/downloads/api-myodbc-3.51.html
Driver odbc.net download address: http://www.microsoft.com/downloads/details.aspx? familyid=6ccd8427-1017-4f33-a062-d165078e32b1&displaylang=en
There are three classes in this library:
Manipstringformysql: This class modifies the SGBD string
Mysql_requettes: Send Request
Mysql_utils: Test the SGBD data
Here is an example of using this class library to manipulate MySQL
The following are the referenced contents:
Manipulating a DataSet
public Shared Function myodbcdataset (ByVal reqsql as String, _
ByVal labase As String, ByVal Server As String, _
ByVal passwo Rd As String, ByVal User As String, _
ByVal Nomdataset As String) as D Ataset
' 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 _
&";D atabase= "& Labase &"; Uid= "& User _
&"; Password= "& PASSWORD &"; option=3; "
dim myodbcconnexion as New odbcconnection (myconstring)
Try
Dim DS as New DataSet ()
Dim cmd As OdbcDataAdapter = new
  &N bsp; OdbcDataAdapter (Reqsql, myconstring)
Dim mycommand As New OdbcCommand ()
Dim MyDataReader as OdbcDataReader
cmd. Fill (ds, Nomdataset)
myodbcconnexion.close ()
return DS
Catch myodbcexception as OdbcException
'
HttpContext.Current.Response.Write (myodbcexception.tostring)
Catch myexception as Exception
HttpContext.Current.Response.Write (myexception.tostring)
end Try
End Function
Call to a function
Dim mondatasettemp as DataSet = Mysql_requettes.myodbcdataset (
Sql
Constantes. Odbcbase,
Constantes. Odbcserver,
Constantes. Odbcpwd,
Constantes. Odbcuser,
"Mondataset")