DataRelationCollection.IndexOf 方法

定义

获取指定数据关系的索引。Gets the index of the specified data relation.

重载

IndexOf(DataRelation)

获取指定 DataRelation 对象的索引。Gets the index of the specified DataRelation object.

IndexOf(String)

获取按名称指定的 DataRelation 的索引。Gets the index of the DataRelation specified by name.

IndexOf(DataRelation)

获取指定 DataRelation 对象的索引。Gets the index of the specified DataRelation object.

public:
 virtual int IndexOf(System::Data::DataRelation ^ relation);
public virtual int IndexOf (System.Data.DataRelation? relation);
public virtual int IndexOf (System.Data.DataRelation relation);
abstract member IndexOf : System.Data.DataRelation -> int
override this.IndexOf : System.Data.DataRelation -> int
Public Overridable Function IndexOf (relation As DataRelation) As Integer

参数

relation
DataRelation

要搜索的关系。The relation to search for.

返回

Int32

该关系的从 0 开始的索引;或者如果在该集合中找不到该关系,则为 -1。The 0-based index of the relation, or -1 if the relation is not found in the collection.

适用于

IndexOf(String)

获取按名称指定的 DataRelation 的索引。Gets the index of the DataRelation specified by name.

public:
 virtual int IndexOf(System::String ^ relationName);
public virtual int IndexOf (string? relationName);
public virtual int IndexOf (string relationName);
abstract member IndexOf : string -> int
override this.IndexOf : string -> int
Public Overridable Function IndexOf (relationName As String) As Integer

参数

relationName
String

要查找的关系的名称。The name of the relation to find.

返回

Int32

具有指定名称的关系的从零开始的索引;或者如果集合中不存在该关系,则为 -1。The zero-based index of the relation with the specified name, or -1 if the relation does not exist in the collection.

适用于