다음을 통해 공유


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 속한 행입니다.

예제

다음 예제에서는 속성을 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 가 테이블의 행 컬렉션에 반드시 속하는 것은 아닙니다. 이 동작은 생성되었지만 에 추가DataRowCollection되지 않은 경우에 DataRow 발생합니다. 속성이 RowState 반환 DataRowState.Detached되면 행이 컬렉션에 없습니다.

적용 대상

추가 정보