The primary key for my object is made up of two fields (and id# and a date). Do I mark both properties with <DataObjectField(True, True)>? What's recommended way for dealing with multipart keys.
Thanks
Yes, that should work. Remember that the DataObjectField attribute is nothing more than a hint to the Web Forms designer about which properties uniquely identify your object. It isn't a very important attribute in the scheme of things.
What is more important is that your GetIdValue() method in your business object must combine those two values so the result is a single unique value. One common, and simple, solution is to convert them to text and merge them:
Protected Overrides Function GetIdValue() As Object
Return String.Format("{0},{1}", mId.ToString, mDate.ToString)
End Function
Copyright (c) Marimer LLC