GetQueryDescription(String) Method
Gets the
QueryDescription object associated with the single (i.e., standalone) table specified by in the currently opened database. This method must be called on the MCT. Use QueuedTask.Run.
Parameters
- tableName
- The name of a valid single (i.e., standalone) table. The name can be unqualified or fully qualified. Regardless of whether it is unqualified or fully qualified, it must match one of the "tableNames" returned from the method GetTableNames.
Return Value
The
QueryDescription object that fully describes how the underlying database table should be represented as a
Table or
FeatureClass if it is a spatial table.
Create Default QueryDescription for a Database table and obtain the ArcGIS.Core.Data.Table for the QueryDescription
public async Task DefaultQueryDescription()
{
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
DatabaseConnectionProperties databaseConnectionProperties = new DatabaseConnectionProperties(EnterpriseDatabaseType.SQLServer)
{
AuthenticationMode = AuthenticationMode.DBMS,
Instance = "instance",
Database = "database",
User = "user",
Password = "password"
};
using (Database database = new Database(databaseConnectionProperties))
{
QueryDescription queryDescription = database.GetQueryDescription("CUSTOMERS");
using (Table table = database.OpenTable(queryDescription))
{
//use table
}
}
});
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.