let I have a table called test and another table called testTwo.
I got a value (row) from table test which isrollNo.
Now i want to check and compare that if there is any row called rollNo exists in my testTwo table.
How can i do this in asp.net? Thanks.
I am adding some sample code here to get the concept that what i am trying to do.
int? rollNO = null;
if (((DataRowView)e.Item.DataItem).Row["rollNO"].ToString() != null && ((DataRowView)e.Item.DataItem).Row["rollNO"].ToString().Trim().Length > 0)
{
rollNO= Int32.Parse(((DataRowView)e.Item.DataItem).Row["rollNO"].ToString());
}
if (((DataRowView)e.Item.DataItem).Row["IsActiveStatus"].ToString() == "False")
{
if (here i want to check that if rollNO row exists in testTwo table)
{
item.CssClass = "Green" + " rgRow";
}
else
{
item.CssClass = "Red" + " rgRow";
}
}