PDA

Click to See Complete Forum and Search --> : Are collections readonly?


CodeMagician
Nov 4th, 2002, 08:32 PM
I have a structure of name tRecord with a public variable sAccountName as String. I load up 10 records and add them to the collection. Now, I want to take the first record and change the sAccountName property. Everytime I access it, I get the following error:

An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll

Additional information: Latebound assignment to a field of value type 'tRecord' is not valid when 'tRecord' is the result of a latebound expression.

How do I edit the record?

Edneeis
Nov 5th, 2002, 01:49 AM
Try switching the Structure to a Class. Maybe the Value Type is messing things up.

CodeMagician
Nov 8th, 2002, 05:14 PM
yeah, it did, but I wonder why...