473,511 Members | 10,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7101
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2656
by: rodchar | last post by:
Hey all, I have an array of data rows that when I bind it to a datagrid it shows all those extra rows in addition to my fields. How do I hide those fields? I tried using the TableStyles...
1
1682
by: Jason | last post by:
I've gathered a bunch of data from Active Directory and placed it into a datatable ("ADTable"). I now need to sort and filter this table based on the selection of a drop down list("ddlCategory"). ...
5
1667
by: Geoff Jones | last post by:
Hi Suppose we have an array of DataRows e.g. Dim drMyRows() As DataRow = myTable.Rows(0).GetChildRows("PricesCompany") generated via a relationship. The question I have is this. Isn't...
3
1608
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
1
1373
by: irnbru irnbru | last post by:
Hi all! I got an array of datarows after a select on a datatable, I want to show the results in datagrid, but it doesnt work, do i have to create a dataview? Please help me out thank you IRNBRU ...
6
6084
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
7
10194
by: randy1200 | last post by:
I have an orders table. Each record in the orders table contains a customer id. I have a customer table. The primary key of each record in the customer table is the customer id. After getting...
9
9307
by: Nathan Sokalski | last post by:
I have a DataTable from which I only need a certain range of the DataRows. What I would like to do is copy a range of rows from one DataTable to a new DataTable like the following: For i As...
3
5382
by: =?Utf-8?B?cG1jZ3VpcmU=?= | last post by:
I have a dataset with 3 tables -- 2 Parent tables and 1 table that is a child table of both the parents. I create a dataview on the child table and set the rowfilter to a value which filters the...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.