TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
akshay rasalakar
NA
128
9.4k
I want to update multiple records in repater using chekbox
May 16 2015 10:43 PM
foreach (RepeaterItem item in rpt1.Items)
{
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
CheckBox chk = (CheckBox)item.FindControl("chk_att");
HiddenField hf_id = (HiddenField)item.FindControl("hf_id");
if (chk.Checked == true)
{
st = "Update tbl_member set Status='Attended' where MemberID=" + hf_id.Value + "";
x = db.ExeQuery(st);
if (x > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "<script>alert('Atteneded')</script>", false);
fillrpt();
}
if (chk.Checked == false)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "<script>alert('Not Atteneded')</script>", false);
}
}
but im getting error in foreach loop Collection was modified; enumeration operation may not execute.
Reply
Answers (
2
)
thumbnail and stack
C#, .NET