Counting rows with a SqlDataAdapter
I have a problem in my co开发者_如何学Gode. I want to get the row count from my SqlDataAdapter
if there are any rows.
Maybe try dt.Rows.Count
since that is a table and has rows.
You were doing an assignment instead of a comparison, you have to use ==
:
if (dt.Rows.Count == 0 )
{
// code here
}
精彩评论