471,317 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

array of datarows to dataview

gl
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.
Dec 19 '05 #1
2 7022
gl wrote:
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
Dec 19 '05 #2
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"gl" wrote:
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.

Dec 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by rodchar | last post: by
1 post views Thread by Jason | last post: by
5 posts views Thread by Geoff Jones | last post: by
1 post views Thread by irnbru irnbru | last post: by
7 posts views Thread by randy1200 | last post: by
9 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by =?Utf-8?B?cG1jZ3VpcmU=?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.