Solved

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

Posted on 2006-11-27
4
517 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now