views:

248

answers:

4

Anyway to view the content of a dataset or datatable in debug? I don't mean looking up a specific element of the dataset but to view the hole thing.

+2  A: 

Yes. Just use the DataSet Visualizer. See this MSDN article about how to use DataTips.

Daniel Pryden
A: 

When you're in Debug stepping through code, just hover over the DataSet and click on the little magnifying glass that is there to open the visualizer.

smoore
I don't get the visualizer and what I do get does not give a view of the data of all the rows.
bochur1
A: 

If you have a particularly large and complex dataset where 'hovering' wouldn't be practical, you can also use the command window. To print values from a dataset, you could use something like the following:

? dsMyDataSet.Tables("NameOfTable").Rows(1).Item("NameOfColumn")

...which would return the value of the named column in the second row (0-based) of the named table in the dataset.

or

? dsMyDataSet.Tables(0).Rows(0).Item(0)

...which would return the value of the first column of the first row of the first table in the dataset.

David
>>I don't mean looking up a specific element of the dataset but to view the hole thing.
bochur1
A: 

I've found the RightHand dataset visualiser particulary useful on many occasions, particulary when debugging constraint errors as it will show you what constraint has been broken and which rows are in error - something the built in visualiser doesn't do as well showing what rows have been added/changed/deleted.

lee-m