Month abbreviation in C#

0 Comments

If you want to use dates in C# like 20-mar-2009, you have to know the month abbreviation, for en-US these are: Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080101", "yyyyMMdd", newCultureInfo( "en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080201", "yyyyMMdd", newCultureInfo("en-US", false)))); Console.WriteLine(string.Format("{0:MMM}", DateTime.ParseExact("20080301", "yyyyMMdd",

Convert byte [] array to hex string

0 Comments

/// <summary> /// Convert a byte array to a hex string /// </summary> /// <param name="bytes"></param> /// <returns> /// Converted byte array to string /// null, when bytes == null /// </returns> public string ConvertByteArrayToString(byte[]

Insert image with TSQL and a hex string

0 Comments

You can insert an image from t-sql script, if you use the hex string notation: The next line will insert an image representing a "check mark" into the database. In a table [Test] with a

C# convert a BitMap to Byte[]

2 Comments

/// <summary> /// Covert a bitmap to a byte array /// </summary> /// <param name="bitmap"></param> /// <returns> /// byte array, when bitmap could be converted /// null, when bitmap is null /// null, when bitmap