H
hufaunder
I wonder about the pros and cons of a setter for an index property. As
an example let's look at the Dataset
DataSet ds;
.....
ds.Tables[0] = new Table(); //Assume Tables[0] exists already
The above will generate a compile error. Why is this allowed? Tables
basically looks like an array/list to the user and arrays and lists
allow this assignment. What is the logic behind this limitation? What
are the pros/cons in general, i.e. not just for the above example but
any custom class that has an indexed property?
Thanks
an example let's look at the Dataset
DataSet ds;
.....
ds.Tables[0] = new Table(); //Assume Tables[0] exists already
The above will generate a compile error. Why is this allowed? Tables
basically looks like an array/list to the user and arrays and lists
allow this assignment. What is the logic behind this limitation? What
are the pros/cons in general, i.e. not just for the above example but
any custom class that has an indexed property?
Thanks