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);
}
}
}
Try using table search and QueryFilter instead.
using (var tbl = featLayer.GetTable()).....
var queryFilter = new QueryFilter
{...
using (var rowCursor = tbl.Search(queryFilter, false))....
The example uses a QueryDef
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.
The table search and QueryFilter works for one table only? How to query more than one table?
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
it's a sql database. after fixed the syntax error, still got the same error.
SQL Server, Oracle, Postgres, etc. are all sql databases. Which one are you using?
Is your WhereClause causing the problem? There's a bracket instead of a space
AND[FMB4_LatestWellStatusPackageProduct.R_WELL_STATUS_ID
Thanks! that is a typo. I corrected it and tried again, still got the same exception message: The method or operation is not implemented.