-1

Database Oracle 11g: I have 2 table to be join (user,comment) in user table have PK User_ID and Name and in comment table have FK User_ID and Text. I want to show Name and Text in GridView using EntityDataSource, it's work fine but when I do sort in GridView it not show proper sort for Name since name have capital and lower case, like this when I do Sort in GridView:

  NAME
Ahmed ali
Bobby baby
ahmed ali
boby baby

I want to be like this (sort and capitalize initial letter to each word):

  NAME
Ahmed Ali
Ahmed Ali
Bobby Baby
Bobby Baby

My EntityDataSource like this:

 <asp:EntityDataSource ID="***" runat="server"
                       ConnectionString="***"
                       DefaultContainerName="***"
                       EnableFlattening="False"
                       CommandText="select it.[NAME], co.[TEXT] from USER as it, COMMENT as co where it.[User_ID] = co.[User_ID]">
 </asp:EntityDataSource>

1 Answers1

0

I'm unsure which column is 'A, A, B, B' but for the shake of the example I'm assuming it is 'it.[NAME]'

change the command text to the following:

 CommandText="select UPPER(it.[NAME]), co.[TEXT] from USER as it, COMMENT as co where it.[User_ID] = co.[User_ID] order by UPPER(it.[NAME])">
Nick Otten
  • 702
  • 7
  • 17