Hi Experts.... can u suggest me how to find if the dataset has rows..I am comparing textbox value with table value..
If dataset has rows it should execute some code and if dataset has no rows it should execute some other data..Thanks in advance
Loading


Mayur GujrathiRank #666 · 3.6K reputationPosted May 5, 2011, 10:08 PM EDT
if(ds.Tables(0).Rows.count > 0)
{
Execute code
}
else
{
Execute else code.
}
here ds is dataset
Ankit NandekarRank #703 · 3.4K reputationPosted May 5, 2011, 10:46 PM EDT
DataSet ds = new DataSet();
if( ds.Tables[0].Rows.Count>0)
{
write code which u want to execute when row is present in dataset
}
else
{
write code which u want to execute when row is not present in dataset
}
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted May 6, 2011, 12:05 AM EDT