开发者

Counting rows with a SqlDataAdapter

开发者 https://www.devze.com 2023-02-20 12:13 出处:网络
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 assign

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号