Solved

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

Posted on 2006-11-27
4
523 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
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 125 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 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