I am trying to use query table to create a list of strings, mukey, associated with specific counties, to use for further geoprocessing with other tables in the same geodatabase. I created a dictionary with the county as the key and mukey as the value to query the list of mukeys. However, I have an error: CS1061 at "MUResults[county].Add(mukey)" saying there is no accessible extension method to Add. I am wondering what I can do to resolve this problem? Here is my script below:
using (Geodatabase geodatabase = new Geodatabase(connection))
{
QueryDef queryDef = new QueryDef
{
Tables = "MUPOLYGON.Name",
SubFields = "MUPOLYGON.OBJECTID, MUPOLYGON.AREASYMBOL, MUPOLYGON.MUSYM, MUPOLYGON.MUKEY",
};
QueryTableDescription queryTableDescription = new QueryTableDescription(queryDef)
{
Name = "MUTable",
PrimaryKeys = geodatabase.GetSQLSyntax().QualifyColumnName("OBJECTID", "AREASYMBOL"),
};
Table queryTable = geodatabase.OpenQueryTable(queryTableDescription);
using (RowCursor rowCursor = queryTable.Search())
{
while (rowCursor.MoveNext())
{
using (var row = rowCursor.Current)
{
var county = Convert.ToString(row["AREASYMBOL"]);
var mukey = Convert.ToString(row["MUKEY"]);
if (MUResults.ContainsKey(county))
MUResults[county].Add(mukey);
....
Thanks for your help!