Click here to Skip to main content
15,888,243 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

My problem is I am using filter expression in gridview with two control parameters with or operator. But or operator is not working ?

I mean i have to fill both textbox control then data display otherwise default gridview is showing.

My code is

XML
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:hospital %>"
                            DeleteCommand="DELETE FROM [Purchaseentry] WHERE [Billno] = @Billno"
                            SelectCommand="SELECT * FROM [Purchaseentry]  " FilterExpression="Convert(bill , 'System.String') LIKE '{0}%' OR itemname Like '{1}%'"
                            UpdateCommand="StoredUpdatepurchase" UpdateCommandType="StoredProcedure"
                              >
                            <FilterParameters>
                               <asp:ControlParameter Name="bill" ControlID="txtSearch" PropertyName="Text" ConvertEmptyStringToNull="true"   />
                                  <asp:ControlParameter Name="itemname" ControlID="txtitemname" PropertyName="Text" ConvertEmptyStringToNull="true"   />

                           </FilterParameters>
Posted

1 solution

 
Share this answer
 
Comments
veenusethi 7-Feb-13 2:01am    
i already checked that link in that link and operator is used which is perfect but or operator is not working
veenusethi 11-Feb-13 2:32am    
nobody here for helping me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900