简体   繁体   English

如果列的值为 0,如何隐藏行 - 使用 C#(WPF),SQL

[英]How to hide a row if a column's value is 0 - using C#(WPF),SQL

I am doing a project that let the students add books.我正在做一个让学生添加书籍的项目。 And for these books there is quantity that shows how much quantity do the library have of a selected book.对于这些书籍,有数量显示图书馆有多少选定的书籍。 So my question is that When Book quantity have (0) value I want the book to be hidden from the dataGridView so student can't see it.所以我的问题是,当书籍数量具有 (0) 值时,我希望将这本书从 dataGridView 中隐藏,这样学生就看不到它。

How do hide the row of the book that has 0 value?如何隐藏价值为 0 的书的行?

C#, WPF, SQL C#、WPF、SQL

Best Regards此致

Omar Dak Elbab奥马尔·达克·厄尔巴布

simple where :简单的where

select * from bookstable
where quantity <> 0 

use this query as your datasource in datagrid将此查询用作数据网格中的数据源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM