//The function to bind the database data to your CheckBoxList Control
protected void bindYourList
()
{
SqlConnection objConn =
new SqlConnection
(System.
Configuration.
ConfigurationSettings.
AppSettings["SqlServer"]);
SqlCommand objCmd =
new SqlCommand
("select description, id from notificationLists", objConn
);
objConn.
Open();
cblList.
DataSource = objCmd.
ExecuteReader(CommandBehavior.
CloseConnection);
cblList.
DataBind();
}
//In the Page_Load function call your behind method.
bindYourList
();
//in your aspx page make sure to declare your CheckBoxList and define the DataTextField and DataValueField parameters.
<asp:checkboxlist id=
"cblList" runat=
"server" DataTextField=
"description" DataValueField=
"id">