ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data Namespace / SQLSyntax Class / GetSupportedStrings Method
A constant that specifies the type of SQL string.
Example

In This Topic
    GetSupportedStrings Method
    In This Topic
    Gets all of the supported strings corresponding to sqlStringType, e.g., SQLStringType.InvalidCharacters. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public IReadOnlyList<string> GetSupportedStrings( 
       SQLStringType sqlStringType
    )
    Public Function GetSupportedStrings( _
       ByVal sqlStringType As SQLStringType _
    ) As IReadOnlyList(Of String)

    Parameters

    sqlStringType
    A constant that specifies the type of SQL string.

    Return Value

    A IReadOnlyList of supported strings corresponding to sqlStringType.
    Exceptions
    ExceptionDescription
    sqlStringType is not a field of SQLStringType.
    A geodatabase-related exception has occurred.
    Example
    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 + "'绿'"
      };
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also