I have a datatable with approx. 5000 records and put it in a dataset/datatable
what’s the fastest way to sort these ?
- By the database ? (SQL Server 2008)
- By the datatable ? dt.Select(“”, “order by columns”);
- LINQ ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you have a real database server, and the database is correctly indexed, the fastest way to do it would be to push the sort down to the database.
If you assume everything is runing on your laptop, I would still take an indexed sort over an in-memory sort(linq).