MySQL Connectivity

Here are some very explicit instructions for the class to follow:

  1. Go to http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-1.0.4.zip/from/pick
  2. Select a mirror, and save the zip file somewhere that they can find it
  3. Unzip the file
  4. Double click the .msi file to install it (complete install, don't change the path or any other options)
  5. Start Visual Studio .NET 2003
  6. Select "New Project"
  7. In the New Project dialog box select "ASP.NET Web Application"
  8. 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)
  9. Go to Project->Add Reference
  10. Click the Browse button
  11. Find C:\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySQL.Data.dll and select it. Then hit Open.
  12. Click OK on the Add Reference dialog box
  13. 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")