DataKey / DataKeyField / DataKeyNames
Can someone please help explain the difference between the three..and also help with the following:
I am trying to reference a field that is returned from my objectdatasource without having to put a control on the page. It was suggested that I use DataKeys - but I have always understood DataKeys to represent (I might be getting this confused with DataKeyNames?) the primary key of return. So, I am actually having returned the key, memberID, along with fName, lName, UserID and a few others. I am wanting to get access to "UserID" - which is not my primary key....and thus I am getting extremely confused with DataKey, DataKeyField & DataKeyNames.
I know, in my DataList, that I can set a "DataKeyField"---can I only reference (in the code-behind methods) fields that I put in here...thus, when I do something like DataList1.DataKeys(something)--I can only reference what I put on the control's "DataKeyField" property?---AND, as I mentioned earlier--can I reference stuff outside the primary key (let's say I wanted lname) while still not breaking what is needed to have a primary key in case the row is selected for an update or soemthing else?
Please help.
Sincerely,
Rob
|