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 ShowDataReaderV alues( IDataReader idr)
{
bool keepChecking = true;
int counter = 0;
bool resultSetExists = true;//assume at least 1 result set
if (null != idr)
{
while (resultSetExist s)
{
while (idr.Read())
{
keepChecking = true;//reset
counter=0;//reset
Console.WriteLi ne ("------------------------------");
while (keepChecking == true)
{
if (!idr.IsDBNull( counter))
{
object o = idr.GetValue(co unter++);
Console.WriteLi ne (o.ToString());
}
if ( counter>=idr.Fi eldCount )
{
keepChecking=fa lse;
}
}
}
resultSetExists = idr.NextResult( ); // this will figure out if there is
another result set
}
}
}
"js" <js@so*****@hot mail.com> wrote in message
news:eH******** *****@TK2MSFTNG P02.phx.gbl...
thanks sloan...
"sloan" <sl***@ipass.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP05.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 ShowDataReaderV alues( 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(co unter++);
Console.WriteLi ne (o.ToString());
}
if (counter>idr.De pth)
{
keepChecking=fa lse;
}
}
}
}
"js" <js@so*****@hot mail.com> wrote in message
news:uG******** ******@TK2MSFTN GP05.phx.gbl... Hi, I want to debug the return idatareader, how to print out some
fields value? many thanks.