Notes on VB.NET MySQL Interface March 10 2005
Here are my notes on interfacing VB.NET with MySQL databases.
=== .NET MySQL Interface
Installed MySQL Connector Net 1.04 (http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-1.0.4.zip/from/pick)
Added Reference in .NET project to c:program filesMySQLMySQLConnectorNet …bin.NET 1.1[LIBRARY].dll
DB Connection String :: DB_CONNECTION_STRING = “Database=” & DB_DATABASE & “;Data Source=” & DB_HOST & “;User Id=” & DB_UID & “;Password=” & DB_PWD
Sample Program Template
Imports MySql.Data.MySqlClient
_mysqlConnection = new MySQLConnection(DB_CONNECTION_STRING)
Dim dtrResults As MySqlDataReader
cmdSelect = New MySqlCommand( SQL COMMAND , _mysqlConnection )
_mysqlConnection.open
_mysqlConnection.Open()
dtrResults = cmdSelect.ExecuteReader()
While dtrResults.Read()
intResults = intResults + 1
strResult = strResult & dtrResults(" COLUMN NAME") & dtrResults(" ANOTHER COLUMN NAME ")
End While
dtrResults.Close()
_mysqlConnection.Close()
- Posted in : .NET
- Author : site admin

Comments
Sorry comments are closed for this entry