? MyDataset.MyTable.Select("CustomerId=5").Length
Will give the number of rows satifying the filter condition.
If you want to display the row
? MyDataset.MyTable.Select("CustomerId=5")(0)
Would return the first rowin the array of return rows that satisfied the criteria of the filter
condition. If you are using a untyped dataset you will get a bunch of lines about
Item: <cannot view indexed property>
so you will have to further refine your search
? MyDataset.MyTable.Select("CustomerId=5")(0)("My Property")
If you are using typed datasets your own version of the query below should pull up enough info to be
of use
? ctype(_customers.Customer.Select("CustomerId=90004")(0), dsCustomer.CustomerRow)
Here i am querying the Customer table in a dataset called _customer which is of type dsCustomer for
all rows which have a customerId of 90004. This will return an array of datarows;of which i am
casting the first from the base type of datarow as returned by the select method to the strongly
typed dsCustomer.CustomerRow:
Assumming a row matching this criteria is found the immediate window will return a list of field
values for this particular row:
{dsCustomer.CustomerRow}
AKey: "fffffff"
CustomerId: 90004
DCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
DZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Email: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Fax: <error: an exception of type: {System.Data.StrongTypingException} occurred>
HasErrors: False
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Item: <cannot view indexed property>
ItemArray: {Length=26}
Name: "Rodger Bannister"
PCity: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PCountry: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Phone1: "021 240 7444"
Phone2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PhoneFree: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStateRegion: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet1: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PStreet2: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PSuburb: <error: an exception of type: {System.Data.StrongTypingException} occurred>
PZipcode: <error: an exception of type: {System.Data.StrongTypingException} occurred>
RowError: ""
RowState: Unchanged
SalesCallStatus: 4
SalesRoute: 2
SalesTerritoryId: 3
Table: {dsCustomer.CustomerDataTable}
Website: <error: an exception of type: {System.Data.StrongTypingException} occurred>
Anything like <error: an exception of type: {System.Data.StrongTypingException} occurred> generally
means that the strongly typed dataset contains a value of Null for that field.
hth
Richard