views:

240

answers:

1

I'm building a semi-elaborate RadGrid where within my NestedViewTemplate I want to have a LinqDataSource that uses a Stored Procedure to get data from the database.

Here's what I have so far

            <asp:HiddenField runat="server" ID="HiddenID" Value='<%#DataBinder.Eval(Container.DataItem, "ID")%>' />
            <asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource_Selecting">
                <WhereParameters>
                <asp:ControlParameter ControlID="HiddenID" PropertyName="ID" Type="String" Name="ID" />
                </WhereParameters>
            </asp:LinqDataSource>

any my Code Behind...

Protected Sub LinqDataSource_Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs)


    Dim hdc As New DAL.HealthMonitorDataContext()
    e.Result = hdc.bt_HealthMonitor_GetByID(Integer.Parse(e.WhereParameters("ID")))
End Sub

but unfortunately hdc.bt_HealthMonitor_GetByID(Integer.Parse(e.WhereParameters("ID"))) isn't playing nice...

Exception Details: System.FormatException: Input string was not in a correct format.

+1  A: 

Forget it, I had the "PropertyName" incorrect in the WhereParameters.

<asp:ControlParameter ControlID="HiddenID" 
                      PropertyName="Value" 
                      Type="String" 
                      Name="ID" />

Basically I'm a retard... sorry.

rockinthesixstring