From: Shengqing Yang [MSFT] on
Hi Gerry,

Based on my understanding, you did a test on the ObjectDataSource you
provided and was surprise to find it's update worked well as you expected
it may have some problem since the properties is read-only.

Actually, I am not quite understand the meaning of this test as although
you used new key word to hide the base properties, the properties of the
child class still return values from base class by the get statements.

Since you did not provide the update method in your code, I simply write
this code for a further test.

public static void Update(immutableObj dat) { Objects[0] = dat; }

And here is the code of the ASP.NET page.

<asp:GridView ID="GridView1" runat="server" DataSourceID="objODS">
<asp:CommandField ShowEditButton="True" />
<asp:CommandField ShowSelectButton="True" />
<asp:ObjectDataSource ID="objODS" runat="server" TypeName="objManager"

When we update the first record in the GridView, we can find the ID value
has been changed. This is because parameter dat is set to Objects[0] as a
completed package and it will not use set statement in this process. So it
is no problem to change the value of the class although the properties are

I hope the explanation above can solve your puzzle of how the update method
works. And if I have misunderstood you, please feel free to let me know.

Bravo Yang
Microsoft Online Support


Get notification to my posts through email? Please refer to

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.

The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at