You can build the criteria part of the query on fly as long as you keep parameters.
Try something like:
criteria="";
if (textbox.text.length != 0)
{
if (criteria.lentgh != 0)
criteria += " AND";
criteria += " name=@name";
cmd.Parameters.AddWithValue("@name", textbox.Text);
}
...
query= "SELECT name,location,age.. FROM tbl1 WHERE" + criteria;
It is just the principle, I let you deal with C# syntax.