I am trying to covert my feature class to feature layer so that i can pass "IQueryByLayer" over my feature class.
Till now i have my feature class —
FeatureClass className = new FeatureClass(cc);
want to do something like
IFeatureLayer newLayer = className.as---(FeatureLayer)
Can anybody point out a correct way to impliment it.
Best Answer
IFeatureLayer
only make sense when your code is working within ArcMap. If that is your case, have a look at this code:Also note that A featureclass cannot be instantiated directly. You can only get it as a result from other methods like IfeatureWorkspace.OpenFeatureClass method.
Code like
FeatureClass className = new FeatureClass(cc);
will not compile