Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. sorting

sorting

Scheduled Pinned Locked Moved C#
databasesql-servercomsysadminalgorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    I wanted the sotring of string column(sql server 2000 database table). the table contains the following entries aa 02 18 1 11 22 1a 2 after sorting these entries by the same column. it gives the following result 02 1 11 18 1a 2 22 aa but the above sorted order is not required. then look at the ascii chart http://www.asciitable.com/[^] Now according to my understanding , i thought i should sort the list in the order in which the ascii codes are listed. Am I doing in the right direction ?

    If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

    J 1 Reply Last reply
    0
    • P Pankaj Garg

      I wanted the sotring of string column(sql server 2000 database table). the table contains the following entries aa 02 18 1 11 22 1a 2 after sorting these entries by the same column. it gives the following result 02 1 11 18 1a 2 22 aa but the above sorted order is not required. then look at the ascii chart http://www.asciitable.com/[^] Now according to my understanding , i thought i should sort the list in the order in which the ascii codes are listed. Am I doing in the right direction ?

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      J Offline
      J Offline
      JustChiragPatel
      wrote on last edited by
      #2

      Hi, yes, if we use ready made sorting function in .NET library then it will sort based on ASCII characters, but here i think your sorting includes numbers and characters and zero based numbers also, so i think you should make your own sorting function which will use Comparer class to compare values and then will sort based on your requirement. Bye :-D .

      Chirag Patel Programmer Analyst India

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups