Skip to main content

Posts

Showing posts with the label ASP.NET C# 6 features

Convert varbinary to string C#

How to convert varbinary to string c#? // convert varbinary to string c# public byte[] binaryData { get ; set ; } // FOR ASCII Encoding string ascii = System.Text.Encoding.ASCII. GetString (binaryData); OR // FOR UTF8 Encoding string utf = System.Text.Encoding.UTF8. GetString (binaryData); OR // FOR Unicode Encoding string unicode = System.Text.Encoding.Unicode. GetString (binaryData); OR // CONVERT BYTE ARRAY TO HEXA string AsString = SecurityManager. ByteToHexBitFiddle (binaryData); // CONVERT BYTE ARRAY TO HEXA public static string ByteToHexString (byte[] bytes) { char[] c = new char[bytes.Length * 2 ]; int b; for ( int i = 0 ; i < bytes.Length; i ++ ) { b = bytes[i] > > 4 ; c[i * 2 ] = (char)( 55 + b + (((b -10 ) > > 31 ) & -7 )); b = bytes[i] & 0xF ; c[i * 2 + 1 ] = (char)( 55 + b + (((b -10 ) > > 31 ) & -7 )); } return new string (...

ASP.NET C# 6.0 Features that every ASP.NET Developer should know about it!

  ASP.NET C# 6.0 Features that every ASP.NET Developer should know about it.         1. Auto-property  initializes         public int ID { get ; set ; }         public bool Role { get ; set ; } = true ;         public string Name { get ; set ; } = string .Empty;         public DateTime CreatedDate { get ; set ; } = DateTime .Now;        2. Expression bodied members                     public string Name => string .Format( "{0} {1}" , FirstName, LastName);         3. Getter-only auto-properties                     public DateTime Bi...

ASP.Net C# Algorithms and OOPs Concepts with Examples [How to]

In this Post, I am going to share the code sample for useful “Algorithms” using the ASP.Net C# console applications. Best Algorithms with Examples Algorithm - Bubble Sort Algorithm - Insertion Sort Algorithm - Selection Sort Algorithm - Recursion Fibonacci Series Algorithm - Fibonacci Series using for loop Algorithm - Armstrong Number Algorithm - Palindrome Program Algorithm - Prime Number Factorial Number using Recursion Reverse string in with and without using reverse function in C# Find the most occurrence of a character in string C#? Count character occurrence of a string using dictionary KeyValuePair C#? Counting the occurrences of every duplicate words in a string using dictionary in C# Constructors Concept ...