DataTable dtTest = new DataTable();
dtTest.Columns.Add("Test1");
dtTest.Columns.Add("Test2");
dtTest.Columns.Add("Test3");
Response.Write(dtTest.Columns.Contains("Test")); // returns false;
Response.Write(dtTest.Columns.Contains("Test2")); // returns true;
Wednesday, September 17, 2008
Wednesday, August 27, 2008
Redirection in c#
Response.Redirect("http://google.com");
Monday, August 25, 2008
Rename a Column in C# DataTable
Consider you have DataTable(dtUser) with 3 columns(ID, NAME, DESC)
if you want to change column name 'DESC' to 'DESCRIPTION',
dtUser.Columns[2].ColumnName="DESCRIPTION";
if you want to change column name 'DESC' to 'DESCRIPTION',
dtUser.Columns[2].ColumnName="DESCRIPTION";
Tuesday, August 19, 2008
Time Zone Drop down using C#.NET
TimeZoneInformation[] arrTzi = TimeZoneInformation.EnumZones();
ddlTimeZone.DataSource = arrTzi; //ddlTimeZone is id of the asp:dropdownlist
ddlTimeZone.DataBind();
ddlTimeZone.DataSource = arrTzi; //ddlTimeZone is id of the asp:dropdownlist
ddlTimeZone.DataBind();
Subscribe to:
Posts (Atom)