Hi community, I am wondering if there is a way to determine if a table or feaure class in a geodatabase is registered as versioned. With ArcPy, I could use arcpy.Describe("MyDataset").isVersioned (or isTraditionalVersioned or isBranchVersioned). Is there an equivalent in the Pro SDK? I appreciate any hints.
Solved! Go to Solution.
Hi,
Sample from ArcGIS Pro API Reference:
public bool IsTableVersioned(Geodatabase geodatabase, string tableName)
{
using (Table table = geodatabase.OpenDataset<Table>(tableName))
{
// Check table version type
RegistrationType registrationType = table.GetRegistrationType();
if (registrationType == RegistrationType.Versioned)
{
return true;
}
}
return false;
}
Hi,
Sample from ArcGIS Pro API Reference:
public bool IsTableVersioned(Geodatabase geodatabase, string tableName)
{
using (Table table = geodatabase.OpenDataset<Table>(tableName))
{
// Check table version type
RegistrationType registrationType = table.GetRegistrationType();
if (registrationType == RegistrationType.Versioned)
{
return true;
}
}
return false;
}
In addition to @GKmieliauskas, to find a versioning type ( Branch or Traditional), versionManager.GetVersioningType() should be called. Please refer to the Pro conceptual doc.
Hi @GKmieliauskas and @Aashis, thanks a lot, this works fine for me. I must have overlooked Dataset.GetRegistrationType() when I was first looking into this. In my (still limited) experience, dataset.GetRegistrationType() works fine, even if dataset is from a Geodatabase gdb with gdb.IsVersioningSupported() == false; in this case it returns Nonversioned, which makes sense and is convenient.