IanG on Tap

Ian Griffiths in Weblog Form (RSS 2.0)

Blog Navigation

April (2018)

(1 item)

August (2014)

(1 item)

July (2014)

(5 items)

April (2014)

(1 item)

March (2014)

(1 item)

January (2014)

(2 items)

November (2013)

(2 items)

July (2013)

(4 items)

April (2013)

(1 item)

February (2013)

(6 items)

September (2011)

(2 items)

November (2010)

(4 items)

September (2010)

(1 item)

August (2010)

(4 items)

July (2010)

(2 items)

September (2009)

(1 item)

June (2009)

(1 item)

April (2009)

(1 item)

November (2008)

(1 item)

October (2008)

(1 item)

September (2008)

(1 item)

July (2008)

(1 item)

June (2008)

(1 item)

May (2008)

(2 items)

April (2008)

(2 items)

March (2008)

(5 items)

January (2008)

(3 items)

December (2007)

(1 item)

November (2007)

(1 item)

October (2007)

(1 item)

September (2007)

(3 items)

August (2007)

(1 item)

July (2007)

(1 item)

June (2007)

(2 items)

May (2007)

(8 items)

April (2007)

(2 items)

March (2007)

(7 items)

February (2007)

(2 items)

January (2007)

(2 items)

November (2006)

(1 item)

October (2006)

(2 items)

September (2006)

(1 item)

June (2006)

(2 items)

May (2006)

(4 items)

April (2006)

(1 item)

March (2006)

(5 items)

January (2006)

(1 item)

December (2005)

(3 items)

November (2005)

(2 items)

October (2005)

(2 items)

September (2005)

(8 items)

August (2005)

(7 items)

June (2005)

(3 items)

May (2005)

(7 items)

April (2005)

(6 items)

March (2005)

(1 item)

February (2005)

(2 items)

January (2005)

(5 items)

December (2004)

(5 items)

November (2004)

(7 items)

October (2004)

(3 items)

September (2004)

(7 items)

August (2004)

(16 items)

July (2004)

(10 items)

June (2004)

(27 items)

May (2004)

(15 items)

April (2004)

(15 items)

March (2004)

(13 items)

February (2004)

(16 items)

January (2004)

(15 items)

Blog Home

RSS 2.0

Writing

Programming C# 5.0

Programming WPF

Other Sites

Interact Software

Viewing DataSets when Debugging in VS.NET

Wednesday 28 July, 2004, 02:52 PM

I was a little confused by Julia Lerman's recent post on how you can see inside a DataSet from the debugger in VS.NET 2005.

I was confused because the screenshots show nothing you can't do with VS.NET 2003, which has been shipping for a while now...

The first screenshot seems to show a DataSet's Tables collection being expanded. Here is the exact same thing being done with a DataSet I'm working on at the moment.

Drilling into a DataSet in VS.NET 2003

It looks less pretty, which is the giveaway that I'm using VS.NET 2003 rather than VS.NET 2005, but it's showing pretty much the same information as Julia's screenshot. The main difference is that my example is using a strongly-typed DataSet, so some of the type names are different. (In fact drilling into strongly-typed DataSets is much easier than this - you don't need to dive into the Tables collection at all - you can just go straight to the named table.)

VS.NET 2003 also lets you drill into the Columns collection as Julia's second screenshot shows VS.NET 2005 doing. And most importantly, VS.NET 2003 also lets you expand the Rows property of a table to see the actual data. (The Columns property just shows you metadata.) I'm assuming VS.NET 2005 supports that too.

It looked to me like VS.NET 2005 wasn't offering anything here I didn't already have in VS.NET 2003, so I contacted Julia to find out what I was missing. After a short spell of confusion caused by each of us seeing different results, we eventually realised that the VB.NET lifestyle is what I was missing. I put together a project that passes a DataSet between a C# and a VB.NET component, and the debugger presents the same DataSet object differently depending on the language of the code you happen to be looking at it from! In C# you get the full guts of the DataSet as shown above, but in VB.NET you get a much smaller selection.

I didn't previously realise that VB.NET showed less information than C# does for the exact same object. You would kind of think that a given object from the .NET Framework Class Library would look the same in the debugger regardless of language - a DataSet doesn't change the way it works just because I'm using it from VB.NET. But the key to understanding this is that VS.NET attempts to present all objects to you in a way that looks right for whatever language you're using. It therefore requires each language to provide an 'expression evaluator' - this is a component used by the debugger to work out how to present information in the debugger. Presumably it was just a limitation in the VB.NET expression evaluator that was preventing you from drilling into a DataSet in the debugger in VS.NET 2003.

So beta 1 of VS.NET 2005 just brings VB.NET up to the same level that C# has always had. This is slightly disappointing, as I was hoping that they would be using the new data visualisation features in VS.NET 2005 to present the contents of the DataSet in an easier to read fashion. Maybe that's coming in the next beta...

Copyright © 2002-2018, Interact Software Ltd. Content by Ian Griffiths. Please direct all Web site inquiries to webmaster@interact-sw.co.uk