Setting Sql Query Output to a list in ASP.NET
I'm working on a project for work, and this issue has been holding me up
all day. My database consists of 9 Columns that are used to identify a
specific row based on user inputs and 7 columns that contain the relevant
data for that user given their inputs match the first 9 columns of the row
match. This may not be the most efficient way of structure the database,
but it's an artifact of the prototype and I'd really rather not change it.
I have a SQL Query that selects the correct row based on the user's
inputs, and now I want to assign a variable to each of the remaining 7
columns (called OA5,OA10,OA15,OA20,OA25,OA30,and OALife), so that I can
graph them for the user. I haven't been able to figure out how to do this
given the way I have my sql query structured below.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:cs_test website %>"
SelectCommand="SELECT * FROM [OARiskData$] WHERE Age = @myAge AND Sex
= @mySex AND Race = @myRace AND FamHx = @myFamRisk AND OccEx =
@myOccRisk AND HxInj = @myHxInj AND BMI = @myBMI AND UnderCost = 1 AND
RiskProg = 0">
<SelectParameters>
<asp:Parameter Name="myBMI" Type="String" />
<asp:Parameter Name="myAge" Type="String" />
<asp:FormParameter DefaultValue="" Name="mySex"
FormField="inputSex" Type="String" />
<asp:FormParameter DefaultValue="" Name="myRace"
FormField="inputRace" Type="String" />
<asp:Parameter Name="myFamRisk" Type="String" />
<asp:FormParameter DefaultValue="" Name="myOccRisk"
FormField="occRisk" Type="String" />
<asp:FormParameter DefaultValue="" Name="myHxInj"
FormField="hxInj" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
No comments:
Post a Comment