Thursday, 21 August 2014

Await in Catch and Finally

Leave a Comment
This is just a brief note to publicize a coming improvement to the async language support. With the new compilers, changes to the C# language (e.g., async/await) are easier than they used to be. One improvement that is coming is the use of await in catch and finally blocks. This enables your error-handling/cleanup code to be asynchronous without awkward code mangling. For example, let’s say that you want to (asynchronously) log an exception in one of your async methods. The natural way to write this is: try {   await...
Read More...

Wednesday, 20 August 2014

HEX to ASCII and ASCII to HEX Class - C#

Leave a Comment
This article shows you how to convert string to hexadecimal and vice versa. HEX TO ASCII Class using System.Collections.Generic; using System.Text; using Microsoft.VisualBasic; // I'm using  this class for Hex Converion namespace Hex_Converter {     public class HexConverter     {         public string Data_Hex_Asc(ref string Data)         {             string Data1 = "";             string sData...
Read More...

Message Box Class - Confirm,Error, Warning and Info - C#

Leave a Comment
A C# Snippet for creating Message Box with various type of message (Confirm,Error, Warning and Info). Message Box Class using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace messageBox {     public static class MsgBox     {         // Displays a Confirm type message box             // parameter name="sMsg" is The message you want to display         public static bool Confirm(string...
Read More...

Convert Hex / Css String color to .NET Colour (RGB)

Leave a Comment
Have you facing problem to convert "#CCCCCC" to .NET Colour.? Here is a solution to convert the CSS / Hex String to .NET Colour (RGB). Conversion Class using System; using System.Collections.Generic; using System.Text; using System; using System.Drawing; using System.Text.RegularExpressions; namespace Convert_Hex_String_to.NET_Color {     public class ConversionClass     {          ...
Read More...

Saturday, 16 August 2014

Register winform app HotKeys - C#

Leave a Comment
Hotkey is a very useful shortcut for complex application. Sometimes we build application with much feature include in it hence will result of bad experience of end user because the feature dont have the shortcut keys. Here is a sample to add shortcut keys or hotkeys for winform app in C# code. GlobalHotkeys.cs using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace Hotkeys {     public...
Read More...

Monday, 4 August 2014

Get each table size in mssql database

Leave a Comment
This is the snippet to get each table size in the schema/catalogue database. MSSQL Code SELECT     t.NAME AS TableName,     s.Name AS SchemaName,     p.rows AS RowCounts,     SUM(a.total_pages) * 8 AS TotalSpaceKB,     SUM(a.used_pages) * 8 AS UsedSpaceKB,     (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM     sys.tables t INNER JOIN         sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN  ...
Read More...

Subscribe to our newsletter to get the latest updates to your inbox.

Your email address is safe with us!




Founder of developersnote.com, love programming and help others people. Work as Software Developer. Graduated from UiTM and continue study in Software Engineering at UTMSpace. Follow him on Twitter , or Facebook or .



Powered by Blogger.