Do you have access to the entity collection at this point?
If you do then you can use it to get a fields collection...
IEntityFields2 fields = myEntityCollection.EntityFactoryToUse.CreateFields();
you can then use the actual field (after finding it in the fields collection using your field name) to create the predicate yourself...
FieldCompareValuePredicate compare = new FieldCompareValuePredicate(myField, null, ComparisonOperator.Equal, myValue);
I originally tried and failed to do it the way you're trying by using the field index enum.
Hope this helps,
Adrian.
p.s. i wrote a function to create a collection give a table name, something like this....
public static EntityCollection CreateCollection(string tableName)
{
// build a string containing the name of the entity factory
string factoryName = tableName + "EntityFactory";
EntityCollection ents = null;
// Get a reference to the current assembly
// build a string containing the fully qualified name of the entity factory
// using the business objects namespace
// + the factoryName
// create an instance of the EntityFactory
// use the EntityFactory to create a new EntityCollection
Assembly ass = Assembly.GetExecutingAssembly();
IEntityFactory2 fac = (IEntityFactory2)ass.CreateInstance("MyRootNameSpace.BusinessObjects." + factoryName, true);
if (fac != null) ents = new EntityCollection(fac);
return ents;
}