public static bool HasColumn(IDataRecord dataReader, string columnName) { for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.GetName(i).Equals(columnName, StringComparison.InvariantCultureIgnoreCase)) return true; } return false; }
How to implement an Object Pool in C#.NET.