Posts tagged ‘.NET’

Visual Studio 2005 does not want to profile my ASP.NET project! What’s up with that?

This is with the Team Edition that has the quite useful “Performance Tools” included. However, when I start a new Performance Wizard I don’t see my ASP.NET web site project in the list of profileable projects.

To make a long story short, the solution is to not select the “No Start Page” option in the debug dialog as shown in the following figure.

Visual Studio 2005 web settings dialog

Checking “Current Page” does not work either. Just to be safe, go with “Specific Page” and pick something from the list.

The problem

Here’s a simplified snippet of what illustrates the problem I had today.

SQLiteCommand cmd = cnn.CreateCommand("SELECT a.a1, b.b1 FROM a INNER JOIN b USING (b1)");
SQLiteDataReader reader = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(reader);
reader.Close();

The problem is that dt.Rows.Count is way lower than what running the same statement in the SQLite CLI produces.

The reason

The reason is that DataTable complains about an invalid constraint on the “b1″ column. Why? Because “b1″ has a unique index in “b” and for some reason DataTable doesn’t like it when you get to entries with the same value for that column regardless that it is perfectly legal when joining tables.

The workaround

I have no idea if this is a problem with SQLite or the AdoNet SQLite wrapper, and I haven’t tried other databases to see if this is not a problem with SQLite at all. The workaround, however, is this:
SELECT a.a1, b.b1 + 0 FROM a INNER JOIN b USING (b1)

That’s an ugly workaround but at least it works.