Thanks,
I looked into the detail. We don’t provide the GetFeaturesByStatement method. But you can do it by yourself. Like you mentioned After you run ExecuteQuery(…) You will get ID, column values and sqlservergeometry. I put the full code we get the feature from dataReader. You may need adjust these code a little to use the datarow instead of dataReader.
private Feature GetFeature(SqlDataReader dataReader, IEnumerable<string> columnNames)
{
string id = null;
byte[] wellKnownBinary = null;
Dictionary<string, string> fieldValues = new Dictionary<string, string>();
List<string> fieldsList = (columnNames == null) ? new List<string>() : new List<string>(columnNames);
for (int i = 0; i < dataReader.FieldCount; i++)
{
string columnName = dataReader.GetName(i);
if (columnName.Equals(featureIdColumn, StringComparison.CurrentCultureIgnoreCase))
{
string value = dataReader[i].ToString();
id = value;
fieldValues.Add(columnName, value);
}
else if (!columnName.Equals(customGeometryColumnName, StringComparison.CurrentCultureIgnoreCase))
{
fieldValues.Add(fieldsList[i], dataReader[i].ToString());
}
else if (dataReader.GetDataTypeName(i).Equals("VarBinary", StringComparison.CurrentCultureIgnoreCase))
{
if (dataReader[i] != DBNull.Value)
{
wellKnownBinary = (byte[])dataReader[i];
}
else
{
wellKnownBinary = new byte[] { };
}
}
}
return new Feature(wellKnownBinary, id, fieldValues);
}
Thanks
Frank