I want to retrieve the records having a text inside the feature class irrespective of field name using Arcobjects.
This would be how you verify the field type to be a text(string). Related samples are at the bottom. http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IField_Type.htm
Best of luck,
Jared
Simply loop all fields of all records from your table:
IEnumerable<IFeature> GetFeaturesBySearchValue(object searchValue)
{
var featureClass = myWorkspace.OpenFeatureClass(fcName);
var cursor = featureClass.Search(null, true);
var fields = featureClass.Fields;
IFeature feature;
while((feature = cursor.NextFeature()) != null)
{
for (int i = 0; i <= fields.FieldCount - 1; i++)
{
var theValue = feature.get_Value(i);
if (theValue == searchValue) yield return feature;
}
}
}
Be aware to also release the features and the cursor when you´re done with them.