473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Applying custom sort order to typed dataset

I have created a typed dataset in .Net 2.0 based on an Access database, and
set up various methods to retrieve specific data from the tables, etc (great
fun). However, I need to implement a custom sort order on a text column. I
know how to implement this in an IComparer and apply it to a custom
collection or an array, but I don't see an easy way to tie this up with my
strongly typed dataset (short of adding the extra step of feeding it into a
custom collection or an array...).

I would welcome any existing code examples of how to do this, or at least
suggestions that might point me in the right direction. Thanks!
Jul 25 '06 #1
2 4844
Emma,

Why not use a DataView on the typed DataTable? In the end, it is a
DataTable, and a DataView is meant to provide this kind of "view" on the
data.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Emma Burrows" <ariana*@*NOSPAM*ntlworld.*comwrote in message
news:uA**************@TK2MSFTNGP02.phx.gbl...
>I have created a typed dataset in .Net 2.0 based on an Access database, and
set up various methods to retrieve specific data from the tables, etc
(great
fun). However, I need to implement a custom sort order on a text column. I
know how to implement this in an IComparer and apply it to a custom
collection or an array, but I don't see an easy way to tie this up with my
strongly typed dataset (short of adding the extra step of feeding it into
a
custom collection or an array...).

I would welcome any existing code examples of how to do this, or at least
suggestions that might point me in the right direction. Thanks!


Jul 25 '06 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:eM**************@TK2MSFTNGP04.phx.gbl...
Why not use a DataView on the typed DataTable?
Thanks for the suggestion. I did have a look into DataView, but it only
seems to allow you to apply a sort order based on a basic SQL statement (eg:
"Title, Author DESC"). My problem is that I need the rows to be sorted on
far more complex criteria than that.

To be specific, I'm sorting book titles by their first significant word; on
the current version of my website, I use XSL to do this (see
http://www.codeproject.com/soap/XSLSorting.asp for details of the sort order
I'm trying to achieve and how I did this in XSL). I'm converting the website
to use .Net features but this is one thing I haven't managed to work out yet
(except using an IComparable object, but I don't see how to apply that to my
DataSet). So suggestions are still welcome. :)
Jul 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: womber | last post by:
I am getting XML from a dataset that has been populated via a storedprocedure no schemas have been applied nor any relationships. But the correct table names have been given to match the table(s)...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
7
by: Jed | last post by:
I have a web service method that returns an array of custom objects marked serializeable with fully described public properties. When I bind the results to a DataGrid I can access the properties...
3
by: Steve Amey | last post by:
Hi all I have created a strong DataSet using Visual Studio. I have been in to the DataSet's vb file to have a look at the code and see if I can add things to it. What I'm after is to create a...
4
by: John Dalberg | last post by:
I noticed the starterkits timetracker & issue tracker load data from a database into custom collections (arraylists) which bind to a datagrid. What are the advantages of using custom collections...
0
by: Wiktor Zychla [C# MVP] | last post by:
Hello, just two sad thoughts on GridView's custom paging support, the first one rather general and second one rather specific. First one: I really miss the DataGrid custom paging support with...
3
by: joey.powell | last post by:
I have a datagridview where I set its "DataSource" property to a DataSet and its "DataMember" property to a table within the DataSet. I need for the DataGridView to "sort" through the contents of...
12
by: Cindy Lee | last post by:
When I do a sorta on 1 table, then the other table goes back to the original order. What can I set so, it keeps the order of the other current gridview's order. I set all the gridview values...
5
by: Simon Woods | last post by:
Hi Does anyone know if there any dotnet software out there which converts a dataset into a collection of custom objects, programmatically i.e. actually creates the class structure and collection...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.