Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

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>
Avatar of Member_6283346
Member_6283346

Hi!
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 %>"/>
Avatar of JRockFL

ASKER

it looks like it is passing that literal value.

This is what it looks like from the sql server trace
exec usp_ListSubProductsByProductID @ProductID=1156,@Culture=N'<%= this.Culture %>'
ASKER CERTIFIED SOLUTION
Avatar of Member_6283346
Member_6283346

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRockFL

ASKER

Awesome, thank you