Since I put the wrong Property.. I fixed it.. (and since you were nice
enough to say thank you)
Here is a version that works "out of the box".
(Don't forget to .Close() those datareaders as soon as you're done with them
!! )
public void ShowDataReaderValues( IDataReader idr)
{
bool keepChecking = true;
int counter = 0;
bool resultSetExists = true;//assume at least 1 result set
if (null != idr)
{
while (resultSetExists)
{
while (idr.Read())
{
keepChecking = true;//reset
counter=0;//reset
Console.WriteLine ("------------------------------");
while (keepChecking == true)
{
if (!idr.IsDBNull(counter))
{
object o = idr.GetValue(counter++);
Console.WriteLine (o.ToString());
}
if ( counter>=idr.FieldCount )
{
keepChecking=false;
}
}
}
resultSetExists = idr.NextResult(); // this will figure out if there is
another result set
}
}
}
"js" <js@so*****@hotmail.com> wrote in message
news:eH*************@TK2MSFTNGP02.phx.gbl...
thanks sloan...
"sloan" <sl***@ipass.net> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Unforunately, there isn't a clean cut way to see the values in the
debugger.
i'm typing this from memory, but should get you started ..........
it probably has some syntax errors, but should be correctable.
public void ShowDataReaderValues( IDataReader idr)
{
bool keepChecking = true;
int counter = 0;
if (null != idr)
{
while (idr.Read())
{
while keepChecking = true;
{
if (!idr.IsDBNull(counter))
{
object o = idr.GetValue(counter++);
Console.WriteLine (o.ToString());
}
if (counter>idr.Depth)
{
keepChecking=false;
}
}
}
}
"js" <js@so*****@hotmail.com> wrote in message
news:uG**************@TK2MSFTNGP05.phx.gbl... Hi, I want to debug the return idatareader, how to print out some
fields value? many thanks.