Reputation: 7451
I have a problem in my code. I want to get the row count from my SqlDataAdapter
if there are any rows.
Upvotes: 1
Views: 15046
Reputation: 160852
You were doing an assignment instead of a comparison, you have to use ==
:
if (dt.Rows.Count == 0 )
{
// code here
}
Upvotes: 4