How to know if a featureclass is from a shapefile

644
3
05-24-2011 06:03 AM
Cristian_Galindo
Occasional Contributor III
Hi.

I have this issue, programmatically i have a feature class get it from a map document, and i want to know if this featureclass comes from a shapefile or a SDE database.

any suggestion is welcome.
0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
Cristian,

Use the IFeatureLayer2 Interface it has a property called DataSourceType which returns a string that describes the source type.

Duncan
0 Kudos
KenBuja
MVP Esteemed Contributor
The only drawback to using the DataSourceType is that it returns a string in the localized language. Take a look at this post for code to get a language-independent identification of what type it is.
0 Kudos
Cristian_Galindo
Occasional Contributor III
thanks for your reply, I alsofound a way to do it:

using the esriWorkspaceType.esriFileSystemWorkspace i can know if there is a system file or a geoDB.

Again Thanks
0 Kudos