DataRow.Table 속성

정의

이 행에 스키마가 있는 DataTable을 가져옵니다.

public:
 property System::Data::DataTable ^ Table { System::Data::DataTable ^ get(); };
public System.Data.DataTable Table { get; }
member this.Table : System.Data.DataTable
Public ReadOnly Property Table As DataTable

속성 값

DataTable

이 행이 속한 DataTable입니다.

예제

다음 예제에서는 속성을 사용하여 열 Table 컬렉션 DataTable에 대한 참조를 반환합니다.

private void GetTable(DataRow row)
{
    // Get the DataTable of a DataRow
    DataTable table = row.Table;

    // Print the DataType of each column in the table.
    foreach(DataColumn column in table.Columns)
    {
        Console.WriteLine(column.DataType);
    }
}
Private Sub GetTable(ByVal row As DataRow)
   ' Get the DataTable of a DataRow
   Dim table As DataTable = row.Table

   ' Print the DataType of each column in the table.
   Dim column As DataColumn
   For Each column in table.Columns
      Console.WriteLine(column.DataType)
   Next
End Sub

설명

A DataRow 가 반드시 테이블의 행 컬렉션에 속하지는 않습니다. 이 동작은 생성되었지만 에 추가되지 않은 경우에 DataRow DataRowCollection발생합니다. 속성이 RowState 반환 DataRowState.Detached되면 행이 컬렉션에 없습니다.

적용 대상

추가 정보