I don't know exactly, but here is a hint:
The Select method returns a DataView object, if the DataSourceMode property
is set to the DataSet value, or a IDataReader object, if the DataSourceMode
property is set to the DataReader value. Close the IDataReader object when
you have finished reading the data.
Cast your return object, as one of the Concrete objects.
string x = (DataView) accessDataSource.Select(...) [0] [1];
(this probably won't work, but I'll explain)
cast the Select as a DataView
[0] means the first Row of data.
[1] means the second column of data. (Select a,b from table1)([1] would be
"b")
You'll have to experiment.
The reason its a IEnumerator is because Select could bring back 3 different
objects.
DataView, or DataSet, and IDataReader. All 3 of those probbably implment
IEnumerator.
DataView might be the wrong cast, fyi. I didn't test the code, I am just
giving a suggestion.
<ty*******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
It was very easy to display the data of an 'AccessDataSource' using
GridView. But is it possible to display it with Label? I found that
there's no DataSourceID attribute for Label, so I think it might be
like,
label.Text=accessDataSource.Select(...);
Am I right? But I don't know how to use this Select(). I looked up MSDN
library but there was no example. The sql query string I set for the
accessDataSource should return a scalar value, but Select() returns
IEnumerable. How can I get the interger value from the IEnumerable?
Please show me simple example for this job. Thanks.