How to save an xml-string into an Xml document
VB.NET Dim xmlText As String = ‘Node1Node2’ Dim xmlDoc As New XmlDocument xmlDoc.LoadXml(xmlText) Dim writer As XmlTextWriter = New XmlTextWriter(Server.MapPath(‘data.xml’), Nothing) writer.Formatting = Formatting.Indented xmlDoc.Save(writer) C# string xmlText = ‘Node1Node2’; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlText); XmlTextWriter writer = new XmlTextWriter(Server.MapPath(‘data.xml’),null); writer.Formatting = Formatting.Indented; xmlDoc.Save(writer);
How to convert user input in dMy format to Mdy
VB.NET Dim dt As DateTime = DateTime.ParseExact(‘0299’, New String() {‘My’, ‘M/y’}, Nothing, System.Globalization.DateTimeStyles.None) C# DateTime dt = DateTime.ParseExact(‘0299’, new string[] {‘My’,’M/y’}, null,System.Globalization.DateTimeStyles.None); For more details refer DateTime.ParseExact
How to get the url of page dynamically
Use Request.Url property
How to clear the Calendar Control Selection
VB.NET Calendar1.SelectedDate =new DateTime() C# Calendar1.SelectedDate =new DateTime();
How to convert string to a DateTime and compare it with another DateTime
VB.NET Dim blntimeIsOk As Boolean = DateTime.Parse(’15:00′) < DateTime.Parse(’08:00′) Response.Write(blntimeIsOk) C# bool blntimeIsOk = (DateTime.Parse(’15:00′) < DateTime.Parse(’08:00′)); Response.Write (blntimeIsOk);