Editor .NET Order parameter
Editor .NET Order parameter
Hello,
.NET Query Order(string order) method has the following description about its Parameters
Type: System.String
Name: order
Description: Columns and direction to order by. Can be specified as individual names or a string of comma separated names. The 'asc' and 'desc' for each column (as in SQL) is optional.
I don't understand how to write the parameters. So far only Order ("par") works. Is there any way to include 'asc' or 'desc'?
Could you provide a example to list parameters as "individual names " and a separate example as "a string of comma separated names" please ?
Thank you,
YL
Answers
I believe it's just added with a space, so
Order("par desc"), and comma-separated if multiples, soOrder("field1 asc, field2 desc").Hope that does the trick,
Colin
Hey Colin,
Thank you for the response.
Order("par desc") did work. However,
Order("field1 asc, field2 desc") didn't work. I had to use the following for multiple columns:
Order(new string[] { "field ", "field2", "field3" })
which seems to be the signature for multiple columns.
What got me confused was the statement "Can be specified as individual names or a string of comma separated names."
Thank you,
YL
I think the individual names is what you've implemented, so each column is in it's own string within the array. Glad all sorted though!
Colin
Thank you, Colin. YL