Sort Array by Date C#
Sort an array of objects by date Given the class below: 1234567891011121314 public class MyClass { public int id; …
Sort an array of objects by date Given the class below: 1234567891011121314 public class MyClass { public int id; …
In C# you can draw a shape on any control. For example: 12345System.Drawing.SolidBrush b = new System.Drawing.SolidBrush(Color.Blue); System.Drawing.Graphics g = System.Drawing.Graphics.FromHwnd(control.Handle); float width = 50; float height = 25; g.FillRectangle(b, …
Generate a random integer in C# 123456789private static readonly Random random = new Random(); private static readonly object lock_random = new object(); public static int GetRandomNumber(int min, int max) { …
Various serialization functions 123456789101112131415public 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 …
Oracle 11gr2 Enterprise data pump export does not include 0 row tables 1C:\> expdp user/secret@SID DUMPFILE=out.dmp SCHEMAS=user LOG=out.txt To correct, extend 0 row tables: 1SELECT ‘ALTER TABLE ‘ || TABLE_NAME …
To determine what tables contain row data 12345SELECT table_name, num_rows FROM all_tables WHERE owner IN (‘USER’) AND num_rows > 0 ORDER BY table_name;
An example of how to use the System.Net namespace to send emails (useful for ssl or tls mail servers). 1234567891011121314151617181920SmtpClient server = new SmtpClient("Smtp.mail.microsoftonline.com"); server.Port = 587; server.EnableSsl = true; …
Useful commands for controlling Epson POS printers. Use ASCII values. a. Cause a cutter activation TM-T88V 27 + 105 ESC + i b. Cause a drawer kick command TM-U375 27 …
12345678910 enum Colour { Red, Green, Blue } // … Colour c = (Colour) Enum.Parse(typeof(Colour), "Red", true); …
1234567891011SELECT ( case when object_type = ‘VIEW’ THEN ‘ALTER VIEW ‘ || object_name || ‘ COMPILE;’ when object_type = ‘PROCEDURE’ THEN ‘ALTER PROCEDURE ‘ || object_name || ‘ COMPILE;’ when …