Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

using SQL Number funcitons in the Sort Expression of DataTable Select method

Posted on 2006-11-27
4
Medium Priority
?
541 Views
Last Modified: 2008-01-16
hi,
     I want to sort the DataTable records based on Sort expression of Select method.
     Actually I am loading Data Table records from a xml file.
     There is one column called "ROWID", this type is char but it contains integer values.
     I want to sort the records based on integer values of the column (ROW_ID).

    So I use the sort expression something like " To_Number(ROW_ID) ASC"

full code

  DataRow[] _drowDataPoints = dtConfigData.Select("Division='PSI", "To_number(ROW_ID) ASC");

but it throws an error saying there is no such column "To_number(ROW_ID) ASC" exists in the DataTable.

I want to sort the records based on number value of the column not char value.

Could you please help me out how to achieve this?

thanks in advance

senthil


 
0
Comment
Question by:e_senthil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 500 total points
ID: 18023545
Well, as you know by now you can't do that. Why don't you cast the value as a number when creating and loading the datatable to start with?
0
 
LVL 29

Expert Comment

by:Nightman
ID: 18198091
Hi e_senthil

Was I able to assist? If not, please can you provide some feedback. Alternatively, have a look at http://www.experts-exchange.com/help.jsp#hs5 for information on closing questions.

Regards
Nightman
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question