Debug-Look at data inside a dataset?

  • Thread starter Thread starter Laurel
  • Start date Start date
L

Laurel

Is there a way, in the debugger, to look at the contents of a dataset? I
tried drilling down into my dataset and it's like exploring the registry!
Anyway, I didn't find anything useful. The code I use to fill the dataset
is below. The dataset fills OK and is usable. I just want to know how it
names things, e.g., if there are multiple instances of a column of the same
name, etc. Right now it can't find Person.Person_ID, although that is part
of my SQL, and there sometimes would be multiple person_id columns in the
result set. (If I modified the sql, of course.)



SqlDataAdapter DBSqlDataAdapter = new SqlDataAdapter(strSQL, DBconnection);

DataSet DBDataSet = new DataSet();

DBSqlDataAdapter.Fill(DBDataSet, strTable);
 
Hello Laurel,

Put the breakpoint on the line beneath of your DBDataSet init, start debuggin
app from VS IDE
and then use QuickWatch debug dialog box to scrutinize the content of your
DBDataSet instance

L> Is there a way, in the debugger, to look at the contents of a
L> dataset? I tried drilling down into my dataset and it's like
L> exploring the registry! Anyway, I didn't find anything useful. The
L> code I use to fill the dataset is below. The dataset fills OK and is
L> usable. I just want to know how it names things, e.g., if there are
L> multiple instances of a column of the same name, etc. Right now it
L> can't find Person.Person_ID, although that is part of my SQL, and
L> there sometimes would be multiple person_id columns in the result
L> set. (If I modified the sql, of course.)
L>
L> SqlDataAdapter DBSqlDataAdapter = new SqlDataAdapter(strSQL,
L> DBconnection);
L>
L> DataSet DBDataSet = new DataSet();
L>
L> DBSqlDataAdapter.Fill(DBDataSet, strTable);
L>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
I'm not sure how this addresses my problem. The problem I face is that when
I look at dsPersonalInfo in the debugger, it shows masses of information,
but nothing about specific columns. So I don't know how to refer to
specific columns to look at the data. Actually, I'm more interested in
learning how C# refers to the specific columns than in the data right now.
For instance, if your SQL joins two tables with "Start_Date" columns that
have different data.

I'm running in a .NET environment, and don't see Quick Watch, but there are
other windows where you can look at variables. As I said, my presenting
problem is that when I look at dsPersonalInfo, it feels like exploring the
registry there's so much data, but nothing about specific columns that I can
find.

Thanks for your response, though.
 
Hello Laurel,

L> I'm not sure how this addresses my problem. The problem I face is
L> that when I look at dsPersonalInfo in the debugger, it shows masses
L> of information, but nothing about specific columns.

Because required info are into collections
When u look at you dataset you can see Tables property that is System.Data.DataTableCollection
You need to refer to the n-elemen to get access to the table - ds.Tables[0]
afterthat u will see the collection of collumns System.Data.DataColumnCollection
and using ds.Tables[0].Columns[0] u get all necessary info about first column
into first table


L>So I don't know
L> how to refer to specific columns to look at the data. Actually, I'm
L> more interested in learning how C# refers to the specific columns
L> than in the data right now. For instance, if your SQL joins two
L> tables with "Start_Date" columns that have different data.
L>
L> I'm running in a .NET environment, and don't see Quick Watch, but
L> there are other windows where you can look at variables.

VS IDE 2005, Debug menu->Windows->Watch

L> As I said,
L> my presenting problem is that when I look at dsPersonalInfo, it feels
L> like exploring the registry there's so much data, but nothing about
L> specific columns that I can find.

Because Tables, Rows, Columns are kept into collections


L> Thanks for your response, though.
L>
L> L>---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Thanks!

Michael Nemtsev said:
Hello Laurel,

L> I'm not sure how this addresses my problem. The problem I face is
L> that when I look at dsPersonalInfo in the debugger, it shows masses
L> of information, but nothing about specific columns.
Because required info are into collections
When u look at you dataset you can see Tables property that is
System.Data.DataTableCollection
You need to refer to the n-elemen to get access to the table -
ds.Tables[0]
afterthat u will see the collection of collumns
System.Data.DataColumnCollection
and using ds.Tables[0].Columns[0] u get all necessary info about first
column into first table


L>So I don't know
L> how to refer to specific columns to look at the data. Actually, I'm
L> more interested in learning how C# refers to the specific columns
L> than in the data right now. For instance, if your SQL joins two
L> tables with "Start_Date" columns that have different data.
L> L> I'm running in a .NET environment, and don't see Quick Watch, but
L> there are other windows where you can look at variables.
VS IDE 2005, Debug menu->Windows->Watch
L> As I said,
L> my presenting problem is that when I look at dsPersonalInfo, it feels
L> like exploring the registry there's so much data, but nothing about
L> specific columns that I can find.

Because Tables, Rows, Columns are kept into collections


L> Thanks for your response, though.
L> L>---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top