views:

444

answers:

2

Hi,

ObjectDataSource1.FilterExpression = "userid LIKE '{0}' AND action LIKE '{1}'";
ObjectDataSource1.FilterParameters.Add("userid", ddlUsers.SelectedValue);
ObjectDataSource1.FilterParameters.Add("action", ddlAction.SelectedValue);

I wirte like this code.

when I run it grid view is empty. BUT, when I write and run it works good.

ObjectDataSource1.FilterExpression = "userid LIKE '{0}' AND action LIKE '{Login}'";
ObjectDataSource1.FilterParameters.Add("userid", ddlUsers.SelectedValue);
ObjectDataSource1.FilterParameters.Add("action", ddlAction.SelectedValue);

Without parameters (action) its shows all login of selected ddlUsers.SelectedValue.

Why does not work like this?

ObjectDataSource1.FilterExpression = "userid LIKE '{0}' AND action LIKE '{1}'";
ObjectDataSource1.FilterParameters.Add("userid", ddlUsers.SelectedValue);
ObjectDataSource1.FilterParameters.Add("action", ddlAction.SelectedValue);
A: 

Does ddlAction have a valid SelectedValue?

Scoregraphic
Yes, is take 'Login' value also, but grid view does not show.
A: 

Yes :) I fould problem;

Before this code I used ObjectDataSource1.FilterParameters.Add("userid", Name); code so 3 filterParameters.

So this query is empty. Grid View shows empty information. I remove all parameters and I add just this two parametes and OK. its shows very good.

:)

atromgame

related questions