DataTable.ExtendedProperties Właściwość

Definicja

Pobiera kolekcję dostosowanych informacji o użytkowniku.

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

Wartość właściwości

Obiekt PropertyCollection zawierający niestandardowe informacje o użytkowniku.

Atrybuty

Przykłady

Poniższy przykład dodaje wartość znacznika czasu do DataTable właściwości za pośrednictwem ExtendedProperties .

private void GetAndSetExtendedProperties(DataTable myTable){
   // Add an item to the collection.
   myTable.ExtendedProperties.Add("TimeStamp", DateTime.Now);
   // Print the item.
   Console.WriteLine(myTable.ExtendedProperties["TimeStamp"]);
}
Private Sub GetAndSetExtendedProperties(ByVal myTable As DataTable)
   ' Add an item to the collection.
   myTable.ExtendedProperties.Add("TimeStamp", DateTime.Now)
   ' Print the item.
   Console.WriteLine(myTable.ExtendedProperties.Item("TimeStamp"))
End Sub

Uwagi

Użyj elementu , ExtendedProperties aby dodać informacje niestandardowe do elementu DataTable. Dodaj informacje za pomocą Add metody . Pobieranie informacji za pomocą Item metody .

Właściwości rozszerzone muszą mieć typ String. Właściwości, które nie są typu Ciąg, nie są utrwalane, gdy DataTable element jest zapisywany jako XML.

Dotyczy

Zobacz też