MySQL Connectivity
Here are some very explicit instructions for the class to follow:
- Go to
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-1.0.4.zip/from/pick
- Select a mirror, and save the zip file somewhere that they can find it
- Unzip the file
- Double click the .msi file to install it (complete install, don't change
the path or any other options)
- Start Visual Studio .NET 2003
- Select "New Project"
- In the New Project dialog box select "ASP.NET Web Application"
- In the Location field enter "http://classweb.students.cob.isu.edu/cis430/<username>/dotnet
(this will create an application sub folder that any asp.net pages can run in,
asp.net pages will not run in their existing folder)
- Go to Project->Add Reference
- Click the Browse button
- Find C:\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySQL.Data.dll
and select it. Then hit Open.
- Click OK on the Add Reference dialog box
- Put in the proper Imports statements and write the VB code to connect to
and retrieve data from the databases.
A quick example can be found at
http://classweb.students.cob.isu.edu/cis430/parkerkr/MySQL_Demo/WebForm1.Aspx
To test your program from within VB.Net don't hit run. Run starts debugging and
you can't debug on the server. Just hit 'view in browser' by either right
clicking on the web page (not the code, the page), or selecting file>view in
browser.
You may want to go into the web.config file and change the custom errors from "RemoteOnly"
to "Off", and yes it is case sensitive. That way if there are any errors it will
display them on the web page in the browser rather than tell you that you can't
see the errors.
Dim mySQLCon As New MySqlConnection("server=134.50.5.137;database=cis430sp05;userid=iusr_cis430;password=opensourceisbad")