I have two objects: 'Table' and 'Record'. 'Table' has a property 'Items' that is an array of type 'Record[]'.
How do I set the 'Items' property of a specific instance of 'Table' (e.g., table.Items[0]) to a specific instance of 'Record' (e.g., first_record)?
I tried to code it as follows, but my code results in a "NullReferenceException was unhandled" error.
Record first_record = new Record();
first_record.Field1 = "r1f1";
first_record.Field2 = "r1f2";
first_record.Field3 = "r1f3";
Record second_record = new Record();
second_record.Field1 = "r2f1";
second_record.Field2 = "r2f2";
second_record.Field3 = "r2f3";
Table table = new Table();
table.Items[0] = first_record;
table.Items[1] = second_record;
Thank you