In C# code, I am using xpath to query against the identity management database. I am trying to find the department that has a displayname "children's hospital".It is throwing error if the string has an apostrophe. - cannot filter as requested.
"/Department[DisplayName='children's hospital']"
If I remove the apostrophe from children's in database as well as code, it is working fine.
"/Department[DisplayName='childrens hospital']"
Here is the C# code to retrieve from idms db.
private string GetObjectID(string xpathQuery)
{
string objectGuid = string.Empty;
string newxpath = string.Empty;
int i = 0;
try
{
foreach (RmResource resource in Client.Enumerate(xpathQuery))
{
if (i == 0)
{
return resource.ObjectID.ToString();
}
}
return null;
}
catch
{
return null;
}
}