.NET Framework - Set QueryStringField from Code

Asked By Jonathan Wood on 09-Dec-08 10:24 PM
I'd like to program my ObjectDataSource object from my page's Load event.

Initially, the object is defined like this:

SelectMethod="Select" TypeName="SoftCircuits.Sounds" EnablePaging="True"
StartRowIndexParameterName="startRow" MaximumRowsParameterName="maxRows"
SelectCountMethod="SelectCount" >
QueryStringField="cat" Type="Int32" />

I want to write code to change the parameter to be a different type and
based on a different querystring. I started with this:

Parameter parm = ObjectDataSource1.SelectParameters[0];
parm.Name = "find";
parm.Type = TypeCode.String;

But Parameter has no property that specify which query string it uses, or
even if it uses a query string. How can I change this programatically?

Thanks.

Jonathan




Jonathan Wood replied on 09-Dec-08 10:38 PM
After playing with this, I am thinking this is the answer:

QueryStringParameter parm =
(QueryStringParameter)ObjectDataSource1.SelectParameters[0];

Jonathan