TypedTableBaseExtensions.ElementAtOrDefault<TRow> 方法

定義

傳回位於序列中指定的資料列的項目;如果資料列超出範圍,則傳回預設值。

public:
generic <typename TRow>
 where TRow : System::Data::DataRow[System::Runtime::CompilerServices::Extension]
 static TRow ElementAtOrDefault(System::Data::TypedTableBase<TRow> ^ source, int index);
public static TRow ElementAtOrDefault<TRow> (this System.Data.TypedTableBase<TRow> source, int index) where TRow : System.Data.DataRow;
public static TRow? ElementAtOrDefault<TRow> (this System.Data.TypedTableBase<TRow> source, int index) where TRow : System.Data.DataRow;
static member ElementAtOrDefault : System.Data.TypedTableBase<'Row (requires 'Row :> System.Data.DataRow)> * int -> 'Row (requires 'Row :> System.Data.DataRow)
<Extension()>
Public Function ElementAtOrDefault(Of TRow As DataRow) (source As TypedTableBase(Of TRow), index As Integer) As TRow

類型參數

TRow

項目的型別或資料列。

參數

source
TypedTableBase<TRow>

要從中傳回項目的可列舉物件。

index
Int32

要擷取的項目之以零為起始索引。

傳回

TRow

位於序列中之指定的資料列的項目。

適用於