0

I'm trying to sort a datatable. But it's not working.

arr[0] = "name"; 
arr[1] = "DESC";

myDataSet.Tables["table1"].DefaultView.Sort = arr[0] + " " + arr[1];

Here, myDataSet refers to dataset I'm using for the reportviewer.

Am I missing something? Is there any other way?

2
  • are you sending the default view back to your report Viewer?. past the bind method as well. Commented Nov 18, 2012 at 10:56
  • The code is correct, but what matter here is how the dataview is used. Commented Nov 18, 2012 at 11:00

1 Answer 1

2

Remmber that you have to use the default view as your new data source for the viewer.

Call your bind method with the defaultView property and then ToTable()

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

Comments

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.