筛选以显示列表视图中的所有记录 [英] Filter to show all records in listview

查看:48
本文介绍了筛选以显示列表视图中的所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨ppl

我正在创建一个过滤的列表视图,而它的过滤效果很好,我想拥有一个显示全部选项,只是不知道该如何使用我试图使用的值IS NOT NULL而不起作用

以下是我用于列表框和数据连接的代码

任何hel都会得到极大的应用

Hi ppl

I am creating a filtered listview, while it is filtering just fine I would like to have a show all option, just don''t know what to make the value I was trying to use IS NOT NULL and didn''t work

Below is my code for the listbox and data connection

Any hel will be greatly appriciated

<asp:ListBox ID="PayD" runat="server" AutoPostBack="True" 
                            DataSourceID="SqlDataSource2" DataTextField="Payment" DataValueField="Payment" AppendDataBoundItems="true">
                            

<asp:ListItem Value="  ???????   " Selected=True>All
                            
                           
                        

      <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:Raw_dataConnectionString %>" 
 SelectCommand="SELECT * FROM [MiscBilling] WHERE ([Payment] = @Payment)">
                            <SelectParameters>           ^Value from Listbox^
                                <asp:ControlParameter ControlID="PayD" Name="Payment" 
                                    PropertyName="SelectedValue" Type="String" />
                            </SelectParameters>

推荐答案

ConnectionStrings:Raw_dataConnectionString%> SelectCommand ="SELECT * FROM [MiscBilling]在哪里([Payment] = @Payment)"> < SelectParameters> ^来自列表框的值^ < asp:ControlParameter ControlID ="PayD" Name =付款" PropertyName ="SelectedValue" Type ="String"/> </SelectParameters>
ConnectionStrings:Raw_dataConnectionString %>" SelectCommand="SELECT * FROM [MiscBilling] WHERE ([Payment] = @Payment)"> <SelectParameters> ^Value from Listbox^ <asp:ControlParameter ControlID="PayD" Name="Payment" PropertyName="SelectedValue" Type="String" /> </SelectParameters>


好.

尝试使用通配符%,例如WHERE Payment LIKE %@Payment%

通常,这对字符串搜索很有用.看看这是否适合您.
Ok.

Try using wild card character %, something like WHERE Payment LIKE %@Payment%

Generally this is good for strings search. See if this fits in for you.


这篇关于筛选以显示列表视图中的所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆