Creating feature class in a geodatabase generates TABLE NOT FOUND error

Discussion created by lfpenedo on May 3, 2010
Latest reply on May 4, 2010 by lfpenedo
I'm using this code from the ESRI arc objects web help:

public IFeatureClass CreateStandaloneFeatureClass(IWorkspace workspace, String featureClassName, IFields fieldsCollection, String shapeFieldName)
            IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
            IFeatureClassDescription fcDesc = new FeatureClassDescriptionClass();
            IObjectClassDescription ocDesc = (IObjectClassDescription)fcDesc;

            // Use IFieldChecker to create a validated fields collection.
            IFieldChecker fieldChecker = new FieldCheckerClass();
            IEnumFieldError enumFieldError = null;
            IFields validatedFields = null;
            fieldChecker.ValidateWorkspace = workspace;
            fieldChecker.Validate(fieldsCollection, out enumFieldError, out validatedFields);

            // The enumFieldError enumerator can be inspected at this point to determine
            // which fields were modified during validation.
            IFeatureClass featureClass = featureWorkspace.CreateFeatureClass
                (featureClassName, validatedFields, ocDesc.InstanceCLSID, ocDesc.ClassExtensionCLSID, esriFeatureType.esriFTSimple, shapeFieldName, "");
            return featureClass;

and I get a message "Table Not found" error message. 

Is this related to a bug fixed in 9.3.1 or there is something else I need to know, to do, or to consider?  I'm running 9.3 sp1.

This is the code that calls the function:

IWorkspace theWSP = CreateFileGdbWorkspace("D:\\", "LuisGDBTest.gdb"); // this works OK

pFeatureLayer.FeatureClass = CreateStandaloneFeatureClass(theWSP, "FLayer",pFeatLayer.FeatureClass.Fields, "SHAPE");  // this is not working

Thanks in advance for any help