February 28, 2005

C# timer

[The Code Project - High-Performance Timer in C# - C# Programming] While there is no explicit performance requirement for this lab, you may find this timer class useful in your self-assessment or improvement.

(Thanks to Doyle for the pointer to the class.)

Posted by jones at 07:25 PM | Comments (0)

February 17, 2005

Reading and writing from an Access database

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 08:09 AM

February 10, 2005

More efficient and stable for C# than for C++?

The word I am getting from people in the class is that visualStudio is much more efficent and stable for C# than C++. The interactive debugger is even fast enough to be useful with C#. That's consistent with my experience. I took a minute to reflect on my visualStudio experience and realized that I have always used it for C# programming. So that's why I was a little surprised when so many of you reported slowness and instability on the first projetc (in which we used C++ you may recall).

What has been your experience?

Posted by jones at 10:38 AM | Comments (0)

February 04, 2005

Debugging

If you can't debug, then you are probably going to struggle with the projects. If you can't see what your program is doing, then you can't debug. Here's some ideas on debugging in VisualStudio.

Keep in mind that the help functionality of VisualStudio is actually pretty good and that we have free online access to the O'Reilly books.