DataTable.ExtendedProperties プロパティ

定義

カスタマイズされたユーザー情報のコレクションを取得します。

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

プロパティ値

カスタム ユーザー情報が格納された PropertyCollection

属性

次の例では、 プロパティを使用して タイムスタンプ値を にDataTableExtendedProperties追加します。

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

注釈

カスタム情報を ExtendedProperties に追加するには、 DataTableを使用します。 メソッドを使用して情報を Add 追加します。 メソッドを使用して情報を Item 取得します。

拡張プロパティの型 Stringは である必要があります。 String 型ではないプロパティは、 が XML として書き込まれるときに DataTable 保持されません。

適用対象

こちらもご覧ください