-1

I have a GridView with the address column, i added a button that calls a filter expression that suppose to look in that column any address, but with this filter expression if the address is not equal the GridView returns blank.

What i need is a filter expression that looks for a word, in that way if the user knows the street or the avenue he can make a correct search.

This is the code with the filter expression called when in the event:

 protected void Button2_Click(object sender, EventArgs e)
    {
        SqlDataSource1.FilterExpression = "Address like '" + TextBox16.Text + "'";
        GridView1.DataBind();
    }
Carlos Ancona
  • 67
  • 2
  • 11

1 Answers1

2
SqlDataSource1.FilterExpression = "Address like '%" + TextBox16.Text + "%'";
Boriss Pavlovs
  • 1,441
  • 12
  • 8