|
-
Mar 20th, 2004, 08:28 PM
#1
Thread Starter
Lively Member
Error Msg : Collection was modified: enumeration operation may not execute
Good day.
I have a datagrid which supposed to receive data input from user and when the user click on Save button, i use the function as below, to iterate throw each datarow and manually append it into db.
For Each objDR In tblUserGroupAdd.Rows
objUserGroup = New My.BusinessFacade.UserGroup
Select Case objDR.RowState
Case DataRowState.Added
objUserGroup.append(objDR("description", DataRowVersion.Default), objDR("remarks", DataRowVersion.Default), Nothing)
tblUserGroupAdd.RemoveTbl_User_GroupRow(objDR)
Case Else
End Select
Next
Upon success, teh datarow will be removed or else, it will remain in the datagrid.
But, when I try to exec the program, it return the error message "Collection was modified: enumeration operation may not execute".
What happen ? Is there any better way to code the same thing instead of the function I am using now ?
Thanks.
SonicWave
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|