Mysql database in .NET

xiaoxiao2021-03-06  62

This is a class library that is written in VB.NET for connecting MySQL. You can use this class library to manipulate the MySQL database.

Before using this class library, you must install 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 in this library have three categories: ManipStringForMySQL: string such modifications SGBD MySQL_Requettes: sending a request MySQL_Utils: the following test data for SGBD This is an example of using this library to operate mysql // to DataSet PUBLIC Shared Function MyodbcdataSet (Byval Labase As String, _ Byval 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) TRY DIM DS AS NEW DATASET () DIM CMD AS ODBCData dapter = New 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) CATCHMEXCEPTION As Exception 'httpcontext.current.response.write (myException.tostring) End Trynd Function // DIM MondatasetTemP as Dataset =

转载请注明原文地址:https://www.9cbs.com/read-119003.html

New Post(0)