DataTable.ExtendedProperties Proprietà
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene l'insieme di informazioni utente personalizzate.
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
Insieme PropertyCollection che contiene informazioni utente personalizzate.
- Attributi
Nell'esempio DataTable seguente viene aggiunto un valore timestamp alla proprietà tramite la ExtendedProperties proprietà .
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
Usare per ExtendedProperties aggiungere informazioni personalizzate a un DataTableoggetto . Aggiungere informazioni con il Add
metodo . Recuperare informazioni con il Item
metodo .
Le proprietà estese devono essere di tipo String. Le proprietà che non sono di tipo String non vengono mantenute quando viene DataTable scritto come XML.
Prodotto | Versioni |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Feedback su .NET
.NET è un progetto open source. Seleziona un collegamento per fornire feedback: