Show only the short time in a grid
<%# String.Format("{0:g}", Eval("ShuffleTime")) %> eg:- 22/11/2010 3:39 PM
There are so many useful formats
<%# String.Format("{0:d}", Eval("ShuffleTime")) %> eg:- 22/11/2010
<%# String.Format("{0:G}", Eval("ShuffleTime")) %> eg:- 22/11/2010 3:39:55 PM
<%# String.Format("{0:M}", Eval("ShuffleTime")) %> eg:- November 22
<%# String.Format("{0:t}", Eval("ShuffleTime")) %> eg:- 11:05 AM
Bind a DataSet/DataTable directly to a DropDown
DataSet dsUnitTypes = ((PageBase)(this.Page)).Services.Game.GetCodeValuesForCodeHeaderName("UnitType");
ddlGameTypes.DataSource = dsUnitTypes.Tables[0];
ddlGameTypes.DataTextField = "Description";
ddlGameTypes.DataValueField = "CodeID";
ddlGameTypes.DataBind();