array of datarows to dataview

G

Guest

What is the quickest way to get an array of datarows (from a typed dataset)
into a dataview (for the purpose of sorting to bind to a datagrid)?

Like i have a function that returns usersDataSet.usersRow[]. I want to take
those results, put it into a dataview, and sort them. I know i could probably
loop through the results one by one, and put them into a datatable, then make
a view from the table, but is there a faster way? Thanks.

If you know any problems with that method let me know too. Thx.
 
M

MuZZy

gl said:
What is the quickest way to get an array of datarows (from a typed dataset)
into a dataview (for the purpose of sorting to bind to a datagrid)?

Like i have a function that returns usersDataSet.usersRow[]. I want to take
those results, put it into a dataview, and sort them. I know i could probably
loop through the results one by one, and put them into a datatable, then make
a view from the table, but is there a faster way? Thanks.

If you know any problems with that method let me know too. Thx.

From my knowledge you can only make a DataView out of a table, so in
your case you will need to create a table and put those rows in there.

But isn't it easier make that function return DataView instead of
DataRow[]?


MuZZy
 
G

Guest

I believe the tables in your DataSet each have a DefaultView property which
is a DataView. You can set the sort and filter properties you need on this
prior to using it for databinding.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top