Disable Sorting on One Field of A Gridview

Go to the Html Source Code and remove the SortExpression or simply set it to blank.

Before

<asp:BoundField DataField="Name" HeaderText="Name" 

SortExpression="Name"  temStyle-HorizontalAlign="Center" 

ItemStyle-Wrap = "false"> <ItemStyle HorizontalAlign="Center"

 Wrap="False"></ItemStyle>
After
 
<asp:BoundField DataField="Name" HeaderText="Name"

 ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap = "false">

<ItemStyle HorizontalAlign="Center" Wrap="False"></ItemStyle>

Order Time SQL Server

Let’s say you want to order these times below. of course  a simple “order by” will not do it,  what you need is the query  given below

1:00 PM,  1:30 PM,  10:00 AM, 10:30 AM, 11:00 AM,

11:30 AM, 12:00 PM, 12:30 PM, 2:00 PM, 2:30 PM,

3:00 PM, 3:30 PM, 4:00 PM, 4:30 PM, 5:00 PM,

5:30 PM, 6:00 PM, 6:30 PM, 7:00 PM, 9:00 AM, 9:30 AM

SELECT Time FROM tablename
ORDER BY CONVERT(SMALLDATETIME, '19990102 ' + Time )

Technically what you are doing is appending the time to a fixed date and let SQL handle the sorting.

List all Users Linux

List all Users Linux

Just copy the following to a file name “listusers” and move it to the “/usr/bin”  folder

gawk -F: ‘{ print $1 }’ /etc/passwd

Then you can run the command %listusers to see all your users without having to remember the command all the time.

 Important: Make sure you change the permission on the file to 755.

chmod 755 /usr/bin/listusers