Blog
157   0

Check Version of Geodatabase using ArcObject.

By Yogesh Sharma Blogs | ArcObject Nov 05, 2012
Check Version of Geodatabase using ArcObject.

Check Version of File Geodatbase/Personal  geodatabse using ArcObject-

We have File Geodatabase of Personal Geodatabase and we want to check version of That Geodatabase.

IWorkspaceFactory pwsf = new AccessWorkspaceFactoryClass();

IWorkspace pws = pwsf.OpenFromFile(@"E:\ARC_PRACTICE\Sample_data\FP_MDBs\FL_01.mdb", 0);

IGeodatabaseRelease2 pGeorel = pws as IGeodatabaseRelease2;

int majVer= pGeorel.MajorVersion;

int minVer = pGeorel.MinorVersion;

 Boolean chkVersionLvl = pGeorel.CurrentRelease;

here majver have values 1,2,3  means major version is 7 plus that number-

if majver is 1 means version is 8.X

if majver is 2 means version is 9.X

if majver is 3 means version is 10.X

if minver is 1 and majver=1 means version is 8.1.

if minver is 2 and majver=2 means version is 9.2.

if minver is 0 and majver=3 means version is 10.0.

 

 One more thing if we want only the geodatabse version is equal to current version level or not then use-


Boolean chkVersionLvl = pGeorel.CurrentRelease;

if chkVersionLvl =True then both version is same(geodatabse and ArcGis)

if chkVersionLvl =False then both version is Different(geodatabse and ArcGis)


 

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs