They seem to be equal. Can both have multiple keys separated by a comma.
views:
516answers:
2
+4
A:
DataKeyNames is where you specify the field names that comprise the key. It's compound to support compound keys.
DataKeys stores the actual key values.
JohnOpincar
2009-05-06 16:23:30
From the gridview markup, does it matter if I use DataKeys="PersonId,FirstName" or DataKeyNames="PersonId,FirstName"
Xaisoft
2009-05-06 16:26:36
+2
A:
Both are diffrent datakeysname are storing the name of the primay key column while datakeys will have the values for the that column.
See the following examples. http://www.highoncoding.com/Articles/87_Accessing_Invisible_Columns_of_GridView_Control.aspx
jalpesh
2009-05-06 16:25:00