Hi everyone,
I want to extract all the rows of a specific field in a given table. This is how I am doing it.
- List<UInt32> outputList= new List<UInt32>();
-
- // Query table
- await QueuedTask.Run(() => {
- using (Geodatabase curGDB = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(selectedGDB))))
- using (Table table = curGDB.OpenDataset<Table>(selectedTable))
- {
- QueryFilter qF = new QueryFilter
- {
- WhereClause = "OBJECTID > 0"
- };
- using (RowCursor rc = table.Search(qF, false))
- {
- while (rc.MoveNext())
- {
- using (Row row = rc.Current)
- {
- outputList.Add(Convert.ToUInt32(row[selectedField]));
- }
- }
- }
- }
- });
My questions is: Is this a good way? Do I have to use "QueryFilter" and move through each row? Is there a better/optimum way?
Many thanks in advance.