Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ExtendedProperties Property

DataSet.ExtendedProperties Property

Gets the collection of customized user information associated with the DataSet.

[Visual Basic]
Public ReadOnly Property ExtendedProperties As PropertyCollection
[C#]
public PropertyCollection ExtendedProperties {get;}
[C++]
public: __property PropertyCollection* get_ExtendedProperties();
[JScript]
public function get ExtendedProperties() : PropertyCollection;

Property Value

A PropertyCollection with all custom user information.

Remarks

The ExtendedProperties property enables you to store custom information with the DataSet. For example, you might store a time when the data should be refreshed.

Extended properties must be of type String if you want them persisted when the DataSet is written as XML.

Example

[Visual Basic, C#, C++] The following example adds a custom property to the PropertyCollection returned by the ExtendedProperties property. The second example retrieves the custom property.

[Visual Basic] 
Private Sub SetProperty(myDataSet As DataSet)
    myDataSet.ExtendedProperties.Add("TimeStamp", DateTime.Now)
End Sub
   
Private Sub GetProperty(myDataSet As DataSet)
    Console.WriteLine(myDataSet.ExtendedProperties("TimeStamp").ToString())
End Sub

[C#] 
private void SetProperty(DataSet myDataSet){
   myDataSet.ExtendedProperties.Add("TimeStamp", DateTime.Now);
}

private void GetProperty(DataSet myDataSet){
   Console.WriteLine(myDataSet.ExtendedProperties["TimeStamp"].ToString());
}

[C++] 
private:
 void SetProperty(DataSet* myDataSet){
    myDataSet->ExtendedProperties->Add(S"TimeStamp",__box(DateTime::Now));
 }
 
 void GetProperty(DataSet* myDataSet){
    Console::WriteLine(myDataSet->ExtendedProperties->Item[S"TimeStamp"]);
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataSet Class | DataSet Members | System.Data Namespace

Show:
© 2015 Microsoft