Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的代码有问题。SqlDataAdapter如果有任何行,我想从我的行数中获取。
SqlDataAdapter
也许尝试一下dt.Rows.Count,因为那是一张桌子并且有行。
dt.Rows.Count
您正在执行分配而不是比较,您必须使用==:
==
if (dt.Rows.Count == 0 ) { // code here }