GetOrdinal 的启示

public int GetOrdinal(string fieldName)
{
if (fieldName == null)
{
throw ADP.ArgumentNull("fieldName");
}
int index = this.IndexOf(fieldName);
if (-1 == index)
{
throw ADP.IndexOutOfRange(fieldName);
}
return index;
}

   

Note: 有些方法表面上看是不会抛出异常的,实际上是会抛出的。

   

你可能感兴趣的:(get)