Blog

Check Version of Geodatabase using ArcObject.

Posted 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
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.