Monday, April 1, 2013

Default Sort for GridView using ObjectDataSource

You can set the default sorting for the grid by setting default column and sort expression as below in page load event.


  protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                gridViewName.Sort("Name", SortDirection.Ascending);
            }
        }


Sunday, March 24, 2013

Attaching Email Messages in WebMail or OWA

While you are logged in to webmail, right click on the message the you would like to attach.  (For Mac users, hold down ctrl and click on the message.)

Select "Forward as Attachment"


The new message window opens and you should see the message you selected listed in the attached field.

Wednesday, February 24, 2010

Fun with inner join

You know any alternative of INNER JOIN??

Here is it....

Table Structure:

Employee Table

LastName

DepartmentID

Rafferty

31

Jones

33

Steinberg

33

Robinson

34

Smith

34

Jasper

NULL

Department Table

DepartmentID

DepartmentName

31

Sales

33

Engineering

34

Clerical

35

Marketing



ORIGINAL ONE:

SELECT Employee.lastName, Employee.DepartmentID, Department.DepartmentName

FROM Employee INNER JOIN Department

ON Employee.DepartmentID = Department.DepartmentID;


ALTERNATIVE ONE:

SELECT Employee.lastName, DepartmentID, Department.DepartmentName

FROM Employee INNER JOIN Department

USING(DepartmentID);


Happy Coding :)


Wednesday, February 10, 2010

Date Formating in GridView

<asp:BoundField DataField="MyDate"  DataFormatString="{0:d}" HeaderText="DaDate"  /> 
Format Pattern NameExample
dShort date format8/27/1989
DLong date format Sunday, August 27, 1989
tShort time format3:32 PM
TLong time format3:32:00 PM
fFull date/time format
(short time)
Sunday, August 27, 1989 3:32 PM
fFull date/time format
(long time)
Sunday, August 27, 1989 3:32:00 PM
g General date/time format
(short time)
8/27/1989 3:32 PM
GGeneral date/time format
(long time)
8/27/1989 3:32:00 PM
m or M Month day formatAugust 27
r or RRFC 1123 formatSun, 27 Aug 1989 8:32:00 GMT
sSortable date/time format 1989-08-27T15:32:00
uUniversable sortable date/time format1989-08-27 15:32:00z
UUniversable sortable date/time formatSunday, August 27, 1989 11:32:00 PM
y or YYear month formatAugust, 1989

--
Avinash
+91-9916513673
avicool08@gmail.com

Sent from Bengaluru, Karnataka, India

Wednesday, November 4, 2009

Color CODE

Color Hex-Code with Name
http://www.keller.com/html-quickref/4a.html



Color: color Name, color code - RGB, Hex, access
http://cloford.com/resources/colours/500col.htm



One more here:
http://www.tayloredmktg.com/rgb/




Here is one more interesting one:(change and see it live)
http://www.drpeterjones.com/colorcalc/


Change the "R+" - Reg , "G+"- Green, "B+"- Blue to see the colour in background.



Happy Coding.... :)