0

I have class StatusesInvestmentRow (from dataSource) where one of the field is ModifiedDate

Investment table:

Id int PK;
ModifiedDate datetime;

How can I sort this arrayby this date?

I found example with IComparable but StatusesInvestmentRow has DataRow type so it is not good way I think.

I have this and I can't change this:

  statInw = new GetAllInvestmentStatuses();

I want add something like:

  var newestStatusInvestment = statInv.Sort(comparerByDate)[0];

1 Answer 1

1

You can actually use DataTable's and DataView's own sorting and selecting functions to do this.

Btw, your tag mentions .NET 2.0 but you're using the var keyword?

Sign up to request clarification or add additional context in comments.

1 Comment

Those select functions return DataRow[]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.