JRockFL
asked on
Sql Datasource and Parameters
I have not used a sql data source before and I'm doing some updates on an existing web site.
In the basepage class that all of the aspx pages inherit from is a property called Culture of type string.
I added the parameter below, is this correct? Do I need to specify anything else or will it extract the value from the property?
<SelectParameters>
<asp:QueryStringParameter Name="ProductID" QueryStringField="prodid" Type="Int32" />
<asp:Parameter Name="Culture" Type="String" />
</SelectParameters>
In the basepage class that all of the aspx pages inherit from is a property called Culture of type string.
I added the parameter below, is this correct? Do I need to specify anything else or will it extract the value from the property?
<SelectParameters>
<asp:QueryStringParameter Name="ProductID" QueryStringField="prodid" Type="Int32" />
<asp:Parameter Name="Culture" Type="String" />
</SelectParameters>
ASKER
it looks like it is passing that literal value.
This is what it looks like from the sql server trace
exec usp_ListSubProductsByProdu ctID @ProductID=1156,@Culture=N '<%= this.Culture %>'
This is what it looks like from the sql server trace
exec usp_ListSubProductsByProdu
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome, thank you
I guess you need to set value for parameter, because it will not be binded automatically:
<asp:Parameter Name="Culture" Type="String" DefaultValue="<%= this.Culture %>"/>