


Now we have a connection using a connection string we created (please note that the DSN is the name we created for the data source in the ODBC Data Source). OdbcConnection connection = new OdbcConnection(connectionStg) String connectionStg = "PROVIDER=MSDASQL DSN=MacDB UID=admin PWD= " Then if we want to access to the data within the data source we need to create a connection, right?

OdbcCommand command = new OdbcCommand(queryString) String queryString = "SELECT * FROM machine" The next step is to create the OdbcCommand that have the SQL query we want to use. First we need to import the libraries we will use.Īs you can see I imported the ODBC library from System.Data Assembly to use this class to connect to our data source. So we are ready to use this data source in our program. NOTES (In case you have Windows 7 64-bit)īecause I have the Windows 7 Pro 64-bit version I need to use the 32-bit ODBC Data Source Administrator Tool because the drivers are in 32-bits for more information please check this article.
