DataKey Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the DataKey class.
Overloads
DataKey(IOrderedDictionary) |
Initializes a new instance of the DataKey class using the specified dictionary of key field values. |
DataKey(IOrderedDictionary, String[]) |
Initializes a new instance of the DataKey class using the specified dictionary of key field values and array of field names. |
DataKey(IOrderedDictionary)
Initializes a new instance of the DataKey class using the specified dictionary of key field values.
public:
DataKey(System::Collections::Specialized::IOrderedDictionary ^ keyTable);
public DataKey (System.Collections.Specialized.IOrderedDictionary keyTable);
new System.Web.UI.WebControls.DataKey : System.Collections.Specialized.IOrderedDictionary -> System.Web.UI.WebControls.DataKey
Public Sub New (keyTable As IOrderedDictionary)
Parameters
- keyTable
- IOrderedDictionary
An IOrderedDictionary that contains the key field values.
Remarks
Use this constructor to create a new instance of the DataKey class using the specified dictionary of key field values. The field values contained in the IOrderedDictionary object passed in for the keyTable
parameter are used to populate the DataKey object.
Note
This version of the constructor does not allow you to specify a list of field names in advance for the DataKey object. Because the field names are not specified in advance, both the field names and values are stored in view state. To specify a list of field names in advance, use the DataKey(IOrderedDictionary, String[]) constructor.
See also
Applies to
DataKey(IOrderedDictionary, String[])
Initializes a new instance of the DataKey class using the specified dictionary of key field values and array of field names.
public:
DataKey(System::Collections::Specialized::IOrderedDictionary ^ keyTable, cli::array <System::String ^> ^ keyNames);
public DataKey (System.Collections.Specialized.IOrderedDictionary keyTable, string[] keyNames);
new System.Web.UI.WebControls.DataKey : System.Collections.Specialized.IOrderedDictionary * string[] -> System.Web.UI.WebControls.DataKey
Public Sub New (keyTable As IOrderedDictionary, keyNames As String())
Parameters
- keyTable
- IOrderedDictionary
The key field values.
- keyNames
- String[]
An array of strings that contain the names of the key fields.
Remarks
Use this constructor to create a new instance of the DataKey class using the specified dictionary of key field values and array of field names. The field values contained in the IOrderedDictionary object passed in for the keyTable
parameter are used to populate the DataKey object. This constructor also allows you to specify a list of the key field names for the DataKey object in advance through the keyNames
parameter. Because the field names are specified in advance, only the key field values are stored in view state when this constructor is used.