c# - SqlDatasource select command is not selecting values from declared columns , it takes all columns that contain the input value -


i have gridview , sqldatasource.

i'm trying select values columns sqldatasource.select command instead of selecting values declared columns search , seletects columns have value searched.also,the value highlighted when found.

 protected void gridview1_rowdatabound(object sender, gridviewroweventargs e)  {              if (e.row.rowtype == datacontrolrowtype.datarow)             {                 foreach (tablecell rws in e.row.cells)                 {                     if (rws.controls.count == 0)                     {                         rws.text = rws.text.replace(search.text, "<span style='background-color:#ffff00;'>" + search.text + "</span>");                     }                 }              }  } 

the button1 select command:

sqldatasource1.selectcommand = "select * ttbs name '%" + search.text + "%' or age '%" + search.text + "%' or birthday '%" + search.text + "%'"; 

is there way fix this?

thanks


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -