Databind CheckBoxList ASP.NET 2.0





-7
Date Submitted Fri. Mar. 10th, 2006 9:32 AM
Revision 1 of 1
Helper ses5909
Tags "ASP.NET 2.0" | C | VB.NET
Comments 2 comments
Databinding in asp.net 2.0 takes very few lines of code. This example shows how to bind a CheckBoxList using a SqlDataSource.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=servername;Initial Catalog=dbname;Integrated Security=True"                                ProviderName="System.Data.SqlClient" SelectCommand="SELECT [id], [description] FROM [notificationLists]">                            </asp:SqlDataSource>
                       
<asp:CheckBoxList ID="chkNotify" runat="server" SataSourceID="SqlDataSource1"                             DataTextField="description" DataValueField="id">                        </asp:CheckBoxList>

...

 

Sara Smith

www.ilovecode.com
Sara

ilovecode

Comments

Comments Repeat after me . . .
Mon. Oct. 9th, 2006 10:38 AM    Scripter sehrgut
Comments SqlDataSource Control
Tue. Oct. 3rd, 2006 10:21 AM    Helper Thomas

Voting