Hi,
I'm using LabelBuilder to assign labels to the events posted on the line feature class, and there's a button for verifying the label. So, for the SDE database, I implemented it using the code below, but I'm not sure how we can do it in FGDB.
For FGDB I tried using QueryDef but getting the Error : SQL statement invalid
***********************************************************************************
string[] message = TxtBoxDescription.Split('+');
Geodatabase fileGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(MapGlobal.Instance.databaseConnection.EventCatalogPath)));
{
QueryDef queryFilter = new QueryDef
{
PrefixClause = message[0],
Tables = TableName,
};
using (RowCursor cursor = fileGeodatabase.Evaluate(queryFilter, false))
{
while (cursor.MoveNext())
{
using (Row row = cursor.Current)
{
// code here
}
}
***************************************************************************************
Could someone please assist me by providing a code snippet for the same?
Thanks in advance!
Solved! Go to Solution.
Hi,
I used the code below, and it worked as expected.
***************************************************
Geodatabase fileGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(MapGlobal.Instance.databaseConnection.EventCatalogPath)));
{
QueryDef queryDef = new QueryDef
{
Tables = TableName,
SubFields = SelectedColumnName,
};
using (RowCursor cursor = fileGeodatabase.Evaluate(queryDef))
{
while (cursor.MoveNext())
{
using (Row row = cursor.Current)
{
// code here
}
}
*********************
Thanks!
An SQL prefix clause supports None, DISTINCT, ALL, and TOP. An SQL postfix clause supports None, ORDER BY, and GROUP BY.
TOP is only supported by SQL Server databases.
Hi,
I used the code below, and it worked as expected.
***************************************************
Geodatabase fileGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(MapGlobal.Instance.databaseConnection.EventCatalogPath)));
{
QueryDef queryDef = new QueryDef
{
Tables = TableName,
SubFields = SelectedColumnName,
};
using (RowCursor cursor = fileGeodatabase.Evaluate(queryDef))
{
while (cursor.MoveNext())
{
using (Row row = cursor.Current)
{
// code here
}
}
*********************
Thanks!
Glad to be of help.