Oracle Managed Driver

1). Launch Visual Studio and install OMD – Click Tools > NuGet Package Manager > Package Manager Console – Type: Install-Package Oracle.ManagedDataAccess – Locate the dll Oracle.ManagedDataAccess.dll and copy it …

Parsing VSS History Files

Parse those nasty VSS history files. Put them in a format more suitable for Gource. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace ConsoleApplication2 { …

Customize XtraReport with C#

Use the scripts window of the report designer private void lblAccountName_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XRLabel l = (XRLabel)sender; string s = l.Text; s = TitleCaseString(s); l.Text = s; } …

Parse Simple XML C#

string s @="<?xml version=""1.0"" encoding=""utf-8"" ?><Parent><Plate>ABC123</Plate></Parent>"; XmlDocument x = new XmlDocument(); x.LoadXml(s); XmlNode rootnode = x["Parent"]; if ((rootnode != null) && (rootnode.HasChildNodes)) {      XmlNodeList nodes = rootnode.ChildNodes;   …

Serialization C#

Various serialization functions public static string SerializeObject(object obj) {     if (obj == null) { return string.Empty; }     System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(obj.GetType());     string s …

C# convert string to enum

   enum Colour    {       Red,       Green,       Blue    }    // …    Colour c = (Colour) Enum.Parse(typeof(Colour), "Red", true); …