GetSupportedStrings Method
Gets all of the supported strings corresponding to , e.g.,
SQLStringType.InvalidCharacters. This method must be called on the MCT. Use QueuedTask.Run.
Parameters
- sqlStringType
-
A constant that specifies the type of SQL string.
Return Value
A
IReadOnlyList of supported strings corresponding to .
Searching a Table for non-Latin characters
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
using (Table table = geodatabase.OpenDataset<Table>("TableWithChineseCharacters"))
{
// This will fail with many database systems that expect Latin characters by default
string incorrectWhereClause = "颜色 = '绿'";
// Correct solution is to prepend the 'National String Prefix' to the attribute value
// For example, with SQL Server this value is 'N'
// This value is obtained using the SQLSyntax class
string nationalStringPrefix = "";
SQLSyntax sqlSyntax = geodatabase.GetSQLSyntax();
nationalStringPrefix = sqlSyntax.GetSupportedStrings(SQLStringType.NationalStringPrefix).First();
// This Where clause will work
QueryFilter queryFilter = new QueryFilter()
{
WhereClause = "颜色 = " + nationalStringPrefix + "'绿'"
};
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.