Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
string s1 = "";
           string s= ((ComboBoxItem)cmbSearchBy.SelectedItem).Content.ToString() ;
          if (cmbSelect.SelectedValue != null)
          {
                 s1 =  (cmbSelect.SelectedValue).ToString();
          }
        dv = new DataView(dt);
        dv.RowFilter = "'" + s.Trim() + "'='" + s1.Trim() +"'";
       dt = new DataTable();
       dt = dv.ToTable();


this is my code where i want to filter record, using condition
but here it is not working

here in cmbsearchby i t select the column name and in cmbselect i select value, but it does not showing any record
Posted
Comments
Madhuri Gamane 11-Dec-14 4:58am    
Got the Solution

string str = "[" + s.Trim() + "]='" + s1.Trim() + "'";
dv.RowFilter = str;

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

  Print Answers RSS


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