Candor.Data.DataRecordExtensions.FieldIndex C# (CSharp) Метод

FieldIndex() публичный статический Метод

Gets the index of a field of a specific name in a record.
public static FieldIndex ( this record, string name ) : int
record this The source record.
name string The field name to find.
Результат int
        public static int FieldIndex(this IDataRecord record, string name)
        {
            for (int i = 0; i < record.FieldCount; i++)
            {
                if (record.GetName(i) == name)
                    return i;
            }
            return -1;
        }