Skip to main content
deleted 8 characters in body
Source Link

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var featurerow = cursor.NextFeatureNextRow();

EDIT: You should allways release the cursor either via ComReleaser-class or by calling Marshall.ReleaseComObject.

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var feature = cursor.NextFeature();

EDIT: You should allways release the cursor either via ComReleaser-class or by calling Marshall.ReleaseComObject.

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var row = cursor.NextRow();

EDIT: You should allways release the cursor either via ComReleaser-class or by calling Marshall.ReleaseComObject.

added 122 characters in body
Source Link

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var feature = cursor.NextFeature();

EDIT: You should allways release the cursor either via ComReleaser-class or by calling Marshall.ReleaseComObject.

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var feature = cursor.NextFeature();

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var feature = cursor.NextFeature();

EDIT: You should allways release the cursor either via ComReleaser-class or by calling Marshall.ReleaseComObject.

Source Link

Basically you CAN run any SQL-statement towards your database, as ArcGIS does this internally also. However the question is: why should you want to do this? In particular there is no gain on using this kind of statement towards your current approach. When you´re interested in a single value of one single row you may limit the selected columns as done by SubFields = ... in combination with a recycling-cursor.

Only improvement is to simply ommit the while-loop and take the very first feature returned by the cursor:

var cursor = myTable.Search(...);
var feature = cursor.NextFeature();