Sunday, 4 August 2013
How to Load CheckBoxList With Database Table Value
Here I will explain how to Load CheckBoxList With Database Table Value using asp:CheckBoxList and asp:SqlDataSource.
Table Definition :
Table value
Code :
<asp:CheckBoxList ID="CheckBoxList2" runat="server"
DataSourceID="SqlDataSource1" DataTextField="language" DataValueField="id">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dreamthewebConnectionString %>"
SelectCommand="SELECT [id], [language] FROM [language]"></asp:SqlDataSource>
Result:
Read how to use aspnet checkboxlist
Table Definition :
Table value
Code :
<asp:CheckBoxList ID="CheckBoxList2" runat="server"
DataSourceID="SqlDataSource1" DataTextField="language" DataValueField="id">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dreamthewebConnectionString %>"
SelectCommand="SELECT [id], [language] FROM [language]"></asp:SqlDataSource>
Result:
Read how to use aspnet checkboxlist
0 comments:
Post a Comment