You might want to look at this code.You can call ChangeVersion(pMxDoc, pOldWorkspace as IFeatureWorkspace, pVersion as IFeatureWorkspace); method after the line //update the layers in the mxdoc in my earlier post. This is the same method name, so you can change the old method name to something like "ChangeVersionByName".
public void ChangeVersionByName(IMxDocument MxDoc, IFeatureWorkspace OldWorkspace, string versionName)
{
try
{
//blah blah....
//update the layers in the mxdoc
ChangeVersion(pMxDoc, pOldWorkspace as IFeatureWorkspace, pVersion as IFeatureWorkspace);
}
catch (Exception ex)
{
}
}
This new "ChangeVersion" method will start to update your map, tables, relationships making them point to the new version .hope this helps.S.