I have created a CIMSqlQueryDataConnection object to retrive data from an oracle database, and displaying in AGP using FeatureLayer. Some of the queries dont return any data, but still showing a layer. Is there a method I can use, to count the number of rows from the queries, and not showing them, that return zero rows?
I am using this code:
using (Database oracleDatabase = new Database(conProperties))
{
Map map = MapView.Active.Map;
CIMSqlQueryDataConnection sqldc = new CIMSqlQueryDataConnection()
{
WorkspaceConnectionString = oracleDatabase.GetConnectionString(),
GeometryType = this.geomType,
OIDFields = "OBJECTID",
Srid = "25832",
SqlQuery = "SELECT * from" + this.tableName,
Dataset = this.tableName
};
FeatureLayer flyr = (FeatureLayer)LayerFactory.Instance.CreateLayer(sqldc, map, layerName: tableName);
}