Technically the program connects to the ODBC connection which manages the MySQL.
This is done in two places. The first in the file windata.cs is a short class that creates, initializes and returns a .NET OdbcConnection object in the Connection property.
class sql
{
private string odbcconnstr="Driver={MySQL ODBC 3.51
Driver};Server=localhost;Database=mydogshows3; User=root;Option=3";
private OdbcConnection connection;
public sql()
{
connection = new OdbcConnection(odbcconnstr) ;
}
public OdbcConnection Connection
{
get
{
return connection;
}
}
}
Next is connecting this to a DataGridView component and this is done in the Forms InitializeDatagridView using a BindingSource object. The DataGridView is a new component in .NET 3.5 and very flexible. As I said earlier it's best used for looking at data but not modifying it.
C# has several classes for connecting with databases. In this case we use an OdbcConnection to talk to the MySQL Connector. Had we used one of the OleDB data types that you can see when you configure with the .udl file (eg Microsoft Jet for MS Access file) you would use an OleDbConnection class.


