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.
我有一个gridview 和sqldatasource。
我想在标签中显示来自gridview的行数,该行数在其中一列中包含某个值(在form_load事件中)
form_load
我考虑过遍历gridview的所有列,但这将花费很多时间,也许还有另一种方法可以做到这一点。
有人可以帮我找到“其他方式”吗?
谢谢,
最好的解决方案是让数据库处理过滤 - 与循环应用程序服务器上的数据相比,您将获得更好的性能。
也许SqlDataSource使用包含适当WHERE条件的 SQL 语句创建另一个并将其绑定到您的标签?
SqlDataSource
WHERE