Select to view content in your preferred language

Geodatabase.Evaluate throw not implemented exception

821
9
01-05-2023 07:54 AM
JinZ
by
New Contributor II

Hi, 

I am trying to execute a query on sql database.I am using ArcgisPro ,Net SDK. I followed the example on the documentation. However I got the method is not implemented exception.

Is this method really not implemented? or did I miss something. 

Thanks much for help.

Here is my code:

using Geodatabase geodatabase = new Geodatabase(connectionProperties);
// Use the geodatabase
QueryDef getMapListQueryDef = new QueryDef
{
SubFields = "FMB4_LatestWellStatusPackageProduct.Name,T_Well.Latitude, T_Well.Longitude, T_WELL.EPSG_NO",
Tables = "FMB4_LatestWellStatusPackageProduct,T_Well ,FMB_Product ",
WhereClause = "FMB4_LatestWellStatusPackageProduct.Well_ID=T_Well.ID AND FMB4_LatestWellStatusPackageProduct.ProductID=FMB_Product.ID AND[FMB4_LatestWellStatusPackageProduct.R_WELL_STATUS_ID <> 210 AND FMB_Product.Name ='" + fmbProduct+"'",
};

using (RowCursor rowCursor = geodatabase.Evaluate(getMapListQueryDef, false))
{
while (rowCursor.MoveNext())
{
using (Row row = rowCursor.Current)
{
string wellname = Convert.ToString(row["Name"]);
codeList.Add(wellname);
}
}
}

0 Kudos
9 Replies
MatthewDriscoll
MVP Alum

Try using table search and QueryFilter instead.

using (var tbl = featLayer.GetTable()).....

var queryFilter = new QueryFilter
{...

using (var rowCursor = tbl.Search(queryFilter, false))....

0 Kudos
KenBuja
MVP Esteemed Contributor

The example uses a QueryDef

0 Kudos
MatthewDriscoll
MVP Alum

Understood.  I was having similar problems getting QueryDef and Evaluate to work and found using QueryFilter and Search was able to accomplish the same goal.  

0 Kudos
JinZ
by
New Contributor II

The  table search and QueryFilter works for one table only? How to query more than one table?

0 Kudos
RichRuh
Esri Regular Contributor

I would start by fixing the syntax error, as pointed out by @KenBuja. I suspect the problem here is a bad error message.

What kind of database is this?

--Rich

0 Kudos
JinZ
by
New Contributor II

it's  a sql database. after fixed the syntax error, still got the same error.

0 Kudos
RichRuh
Esri Regular Contributor

SQL Server, Oracle, Postgres, etc. are all sql databases. Which one are you using?

0 Kudos
KenBuja
MVP Esteemed Contributor

Is your WhereClause causing the problem? There's a bracket instead of a space

AND[FMB4_LatestWellStatusPackageProduct.R_WELL_STATUS_ID

0 Kudos
JinZ
by
New Contributor II

Thanks! that is a typo. I corrected it and tried again, still got the same exception message: The method or operation is not implemented.

0 Kudos