Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Public Function GetRestaurants(ByVal table As ITable) As ICursor
  2.  
  3. ' Create the query filter.
  4. Dim queryFilter As IQueryFilter = New QueryFilterClass()
  5.  
  6. ' Select the fields to be returned - the name and address of the businesses.
  7. queryFilter.SubFields = "NAME, ADDRESS"
  8.  
  9. ' Set the filter to return only restaurants.
  10. queryFilter.WhereClause = "TYPE = 'Restaurant'"
  11.  
  12. ' Use the PostfixClause to alphabetically order the set by name. Although this
  13. ' has no effect on a File geodatabase, this will work for Personal and SDE
  14. ' geodatabases.
  15. Dim queryFilterDef As IQueryFilterDefinition = CType(queryFilter, IQueryFilterDefinition)
  16. queryFilterDef.PostfixClause = "ORDER BY NAME"
  17.  
  18. Dim cursor As ICursor = table.Search(queryFilter, True)
  19. Return cursor
  20.  
  21. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement