Brinkster Knowledge Base
How do I connect to a MySQL database with ASP.NET 1.1
Be sure to make note of the following when using these coding examples:
1. Replace username with your Brinkster hosting account username.
2. Replace password with the password for the account used above.
3. Your specific mySQL server hostname is listed in Website Settings of the Control Panel.
*If you are currently using the ByteFX MySQL data provider, the previous code sample in this article will continue to work.
*In order for this example to work on your local machine, you need to download the latest MySQL Connector from http://dev.mysql.com and install it on your machine. This will generate a dll called MySql.Data.dll that also must be uploaded to your bin folder. You must have the MySql.Data.dll in your bin folder for this example to work.
*Your specific mySQL server is listed in Website Settings of the account control panel (it is not mySQL??). <%@ Import Namespace="mysql.data.MySQLClient" %> <%@ Page language="VB" %> <% Dim conn As MySqlConnection Dim da As MySqlDataAdapter Dim cb As MySqlCommandBuilder Dim connStr As String = "server=MySQL??.Brinkster.com;user id=username; password=password; database=username; pooling=false" conn = New MySqlConnection(connStr) conn.Open() Response.Write("Connection opened") conn.Close() %> |