Error: A datareader associated with this command has been opened. You must first disable it.
Original code:
Public void updatepermissionusertypebyrightid (INT rightid, string usertypes) {var targetlist = listall (). where (S => S. rightid = rightid); foreach (VAR item in targetlist) {item. permissionusertype = usertypes; // Note: if the child node is visible, the parent node must be visible. // modify the permissions of the parent node. If a parent node exists, make sure that the role ID in the parent node is repeated if (item. parentid> 0) {menunodes parent1 = getbyid (item. parentid); string temppusertypes = jimshared. getnooverlapstr (item. permiss Ionusertype, parent1.permissionusertype); parent1.permissionusertype = temppusertypes ;}}//! Submit data commit ();}
After modification: (only a tolist () is added ())
Public void updatepermissionusertypebyrightid (INT rightid, string usertypes) {var targetlist = listall (). where (S => S. rightid = rightid ). tolist (); foreach (VAR item in targetlist) {item. permissionusertype = usertypes; // Note: if the child node is visible, the parent node must be visible. // modify the permissions of the parent node. If a parent node exists, make sure that the role ID in the parent node is repeated if (item. parentid> 0) {menunodes parent1 = getbyid (item. parentid); string temppusertypes = jimshared. getnooverlapstr (ITE M. permissionusertype, parent1.permissionusertype); parent1.permissionusertype = temppusertypes ;}}//! Submit data commit ();}
Datareader associated with this command already opened must be disabled first