ADO.NET and Database features in .NET
topic How can I view my dataset while debugging?
issue I have tried to use the Locals window to view my dataset, but it is practically impossible to find the data in there. Is there a trick to viewing a dataset while debugging?
applies to VB.NET, C#

The easiest way to look at the contents of a dataset is to view it as XML. You can view the XML representation of the dataset using the GetXML() method as follows:

In VB:

dsCustomer.GetXML()
			

In C#:

dsCustomer.GetXML();
			

You can type this line directly into the Command window with a question mark (?) in front of it to dump the contents to the Command window. Or you can use it the Debug.WriteLine or Console.WriteLine within the code itself.

If you would prefer to dump the contents of the dataset to a file so you can search it, use WriteXML instead.

All contents © 2004 InStep Technologies, Inc. All rights reserved.