Is there a .Net CF equivalent of the DataReader.HasRows method?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a .Net Compact Framework equivalent in the system.data.sqlserverce
namespace of the .Net Framework system.data.sqlclient DataReader object's
"Has.Rows" method?

For example:

SqlDataReader rdr = new cmd.ExecuteReader();
if (rdr.HasRows)
{
// do something
}

thanks,
 
Hi Charlie,

There is no "HasRows" support in .NET Compact Framework.
You can use the "Read" property of the SqlDataReader. As it will return a
boolean value it functions the same as that of "HasRows."

Instead of

SqlDataReader rdr = new cmd.ExecuteReader();
if (rdr.HasRows)
{
// do something
}

you can use

if (rdr.Read)
{
// do something
}

Thank you
 
Back
Top