DataSet.ExtendedProperties DataSet.ExtendedProperties DataSet.ExtendedProperties DataSet.ExtendedProperties Property

定义

获取与 DataSet 相关的自定义用户信息的集合。Gets the collection of customized user information associated with the DataSet.

public:
 property System::Data::PropertyCollection ^ ExtendedProperties { System::Data::PropertyCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("ExtendedPropertiesDescr")]
public System.Data.PropertyCollection ExtendedProperties { get; }
member this.ExtendedProperties : System.Data.PropertyCollection
Public ReadOnly Property ExtendedProperties As PropertyCollection

属性值

包含所有自定义用户信息的 PropertyCollectionA PropertyCollection with all custom user information.

示例

下面的示例将自定义属性添加到PropertyCollection ExtendedProperties由属性返回的。The following example adds a custom property to the PropertyCollection returned by the ExtendedProperties property. 第二个示例检索自定义属性。The second example retrieves the custom property.

   private void SetProperty(DataColumn column)
   {
       column.ExtendedProperties.Add("TimeStamp", DateTime.Now);
   }

   private void GetProperty(DataColumn column)
   {
       Console.WriteLine(column.ExtendedProperties["TimeStamp"].ToString());
   }
 Private Sub SetProperty(column As DataColumn)
     column.ExtendedProperties.Add("TimeStamp", DateTime.Now)
 End Sub    
    
 Private Sub GetProperty(column As DataColumn)
     Console.WriteLine(column.ExtendedProperties("TimeStamp").ToString())
End Sub

注解

属性使您可以存储的DataSet自定义信息。 ExtendedPropertiesThe ExtendedProperties property enables you to store custom information with the DataSet. 例如,您可以存储数据的刷新时间。For example, you might store a time when the data should be refreshed.

如果希望在写入为 XML String DataSet时保留这些属性,则扩展属性必须为类型。Extended properties must be of type String if you want them persisted when the DataSet is written as XML.

适用于

另请参阅