Trying to fill Detailsview1 based on the column idmain in Gridview1. The tables involved both have a field called demid (same as alias idmain) which is an integer value uniquely identifying each record in a demographic table. Other records in different tables associated with a particular demographic record have the same demid.
-----------I am getting this error before the gridview1 shows up-Exception Details: System.FormatException: Input string was not in a correct format. With the detailsview and sqldatasource commented out-it does not get an error message and runs ok up to there.
----------What am I doing wrong?
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" ShowHeader="False" AutoGenerateSelectButton="True" DataKeyNames="idmain">
<Columns>
<asp:boundfield DataField="idmain" Headertext="id"> </asp:boundfield>
<asp:boundfield DataField="cname" HeaderText="Child's Name"> </asp:boundfield>
<asp:boundfield DataField="cdob" HeaderText="Child's DOB"> </asp:boundfield>
<asp:boundfield DataField="srv" HeaderText="Service"> </asp:boundfield>
<asp:boundfield DataField="dfrom" HeaderText="dfrom"> </asp:boundfield>
</Columns>
</asp:GridView>
<aspetailsView runat="server" Width="125px" Height="50px" id="DetailsView1" DataSourceID="SqlDataSource1">
</aspetailsView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ %>" SelectCommand="SELECT [demID], [srv], [dfrom] FROM [tblvis] WHERE ([demID] = @demId)">
<SelectParameters>
<asp:controlparameter ControlID="GridView1" PropertyName="SelectedValue" DefaultValue="demid" Name="demID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
-----------I am getting this error before the gridview1 shows up-Exception Details: System.FormatException: Input string was not in a correct format. With the detailsview and sqldatasource commented out-it does not get an error message and runs ok up to there.
----------What am I doing wrong?
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" ShowHeader="False" AutoGenerateSelectButton="True" DataKeyNames="idmain">
<Columns>
<asp:boundfield DataField="idmain" Headertext="id"> </asp:boundfield>
<asp:boundfield DataField="cname" HeaderText="Child's Name"> </asp:boundfield>
<asp:boundfield DataField="cdob" HeaderText="Child's DOB"> </asp:boundfield>
<asp:boundfield DataField="srv" HeaderText="Service"> </asp:boundfield>
<asp:boundfield DataField="dfrom" HeaderText="dfrom"> </asp:boundfield>
</Columns>
</asp:GridView>
<aspetailsView runat="server" Width="125px" Height="50px" id="DetailsView1" DataSourceID="SqlDataSource1">
</aspetailsView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ %>" SelectCommand="SELECT [demID], [srv], [dfrom] FROM [tblvis] WHERE ([demID] = @demId)">
<SelectParameters>
<asp:controlparameter ControlID="GridView1" PropertyName="SelectedValue" DefaultValue="demid" Name="demID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>