« Using theSyllabus for all sect | Main | C# timer »
February 17, 2005
Reading aSyllabus for all sect
For the drill core lab, you get to write you own code to connect to the database. If you are smart and lazy, you might just copy and modify the TA's code for connecting to databases. You used that code in the first two projects. Here are a few ideas for how to adapt their code for this project. Of course, you might also decide to use your own method for connecting to a database. That's fine too.
You will need to add
using System.Data.OleDb; // needed for database code
to list of "using" directives near the top of your file.
The TA's establishConnection function needs a string that gives the location of the database relative to the executable created for your program. As you may know, your executable will live in either <projectHome>/bin/debug or <projectHome>/bin/release. YOu will put your database file in the <projectHome> directory which means that you will need to use ..\\..\\core-samples.mdb as the source string parameter to establishConnection.
In the TA code for the phylogenetics project, the aptly named function "load" loads a problem from the database. You will be reading from tables that have a slightly different and simpler format than in the phylogenetics project.
Here's some more info from the good people at Microsoft. [Creating Connections to Access Databases (Visual Basic and Visual C# Concepts)]
Posted by jones at February 17, 2005 08:09 AM