public int GetOrdinal(string tableName, string name)
{
DataView schema = GetSchemaTable().DefaultView;
schema.RowFilter = String.Format("BaseTableName='{0}' AND ColumnName='{1}'", tableName, name);
if (schema.Count > 0)
return Convert.ToInt32(schema[0]["ColumnOrdinal"]);
else
throw new IndexOutOfRangeException();
}