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

설명

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

적용 대상

추가 정보