Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Get count from selected items in CheckBoxGroup

$
0
0
CheckBoxGroup fill from database
DataSet dsCheckBoxGroup = new DataSet();
                SqlDataAdapter daCheckBoxGroup = new SqlDataAdapter("EXECUTE userGroupSelect '" + Session["userID"] + "'",
                System.Configuration.ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString);
                daCheckBoxGroup.Fill(dsCheckBoxGroup);


                this.cblUserGroups.DataSource = dsCheckBoxGroup.Tables[0];
                this.cblUserGroups.DataTextField = "userGroupName";
                this.cblUserGroups.DataValueField = "userGroupId";
                this.cblUserGroups.DataBind();

In database i have column

userGroupId   userGroupName   userGroupCount

1                    Google                 30

2                    Yahoo                  20

3                    Bing                     10

How get count in hiddenfield or label  after checkd   http://postimg.org/image/dgvj9pys1/   (Google 30 users and Bing 10 users)   -->  count = 40

tnx....


Viewing all articles
Browse latest Browse all 23244

Trending Articles