Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 552
  • Last Modified:

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

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
e_senthil
Asked:
e_senthil
  • 2
1 Solution
 
NightmanCTOCommented:
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
 
NightmanCTOCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now