Click here to Skip to main content
15,908,274 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to bind Id & value to checkboxlist from database
Posted

C#
chklistPermission.DataSource = dr;
chklistPermission.DataTextField = "Name";
chklistPermission.DataValueField = "ID";
chklistPermission.DataBind();


i hope this pice of code work in your application
 
Share this answer
 
v2
CheckBoxList Cb;
Cb.DataSource = Source;
Cb.DataTextField = "Text";
Cb.DataValueField ="Value"
    Cb.DataBind();
 
Share this answer
 
Comments
Sandeep Mewara 23-Apr-12 8:55am    
Cb will thow an error as the CB object was not created! :) Sure you might have missed it while typing your pseudo code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900