all groups > asp.net datagrid control > april 2008 >
You're in the

asp.net datagrid control

group:

Creating a Search in Gridview from an Access datasource


Creating a Search in Gridview from an Access datasource Jay007
4/16/2008 6:17:00 PM
asp.net datagrid control: The Search includes:
A Field such as: AgencyType
An Operator such as: Equals or Like or Less Than
And a Value which is an item in the table like a word, or a number.
In the Submit button Event Handler, how would I go about using the
Accessdatasource.FilterExpression to do ta search like this?
Code so Far:
protected void SearchSubmitButton_Click(object sender, EventArgs e)
{
string searchfield = DropDownListField.Text;
string searchOp = DropDownListOperator.Text;
if (searchOp == "Equals")
{
AccessDataSource1.FilterExpression =
AddThis Social Bookmark Button