如何查看数据表在调试 [英] How to view a DataTable while debugging

查看:120
本文介绍了如何查看数据表在调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用ADO.NET和数据集和数据表。有一个问题我有是它似乎pretty的很难说,因为在调试时,什么样的价值观是在数据表中。

I'm just getting started using ADO.NET and DataSets and DataTables. One problem I'm having is it seems pretty hard to tell what values are in the data table when trying to debug.

什么是一些迅速看到什么值被保存在数据表中最简单的方法?有好歹看到在Visual Studio中的内容,但在调试或写入数据到一个文件中的唯一选择?

What are some of the easiest ways of quickly seeing what values have been saved in a DataTable? Is there someway to see the contents in Visual Studio while debugging or is the only option to write the data out to a file?

我创建了一个小工具功能,将写一个DataTable出到CSV文件。还创建了所得CSV文件被切断。关于3线从我应该已经在写了的System.Guid文件只是停止中间的最后一行。我不能告诉你,这是一个问题,我的CSV转换方法,或DataTable的原始居民。

I've created a little utility function that will write a DataTable out to a CSV file. Yet the the resulting CSV file created was cut off. About 3 lines from what should have been the last line in the middle of writing out a System.Guid the file just stops. I can't tell if this is an issue with my CSV conversion method, or the original population of the DataTable.

更新

忘了后半句我只是忘了冲我流作家。

Forget the last part I just forgot to flush my stream writer.

推荐答案

通过一个破发点集中,后数据表或数据集填充,你可以看到一个放大镜,如果你在变量悬停。如果你点击它,它就会调出数据表展台,你可以阅读有关这里

With a break point set, after the DataTable or DataSet is populated, you can see a magnifying glass if you hover over the variable. If you click on it, it will bring up the DataTable Visualizer, which you can read about here.

在这个图片你看到下面,DT是我的数据表变量和断点被打了几行下面让我悬停在该值。使用Visual Studio 2008。

In this image you see below, dt is my DataTable variable and the breakpoint was hit a few lines below allowing me to hover over this value. Using Visual Studio 2008.

DataTable的可视化图片来源):
替代文字

DataTable Visualizer (image credit):

这篇关于如何查看数据表在调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆