Aperture
Aperture

Reputation: 2427

How do you programmatically assign value to a WHERE clause parameter in EntityDataSource?

I realised a Parameter object does not have a Value property, so how do you assign a value to a parameter?

Upvotes: 0

Views: 1073

Answers (1)

Joel Brown
Joel Brown

Reputation: 14418

You use the DefaultValue property, like so:

edsGrantsList.WhereParameters["FileToken"].DefaultValue = txtToken.Text

In this example, my EntityDataSource is called edsGrantsList and it has a where parameter that is defined like this:

<WhereParameters>
    <asp:Parameter Name="FileToken" Type="String" DefaultValue="" ConvertEmptyStringToNull="true" />
</WhereParameters>

Upvotes: 2

Related Questions