Decompile Code from a .NET Executable

We often lose the source code of the executables we build. If we have the executable with us, we can still retrieve the code using tools such as ILSpy. You

Case Insensitive Comparison of Two Strings

We often compare two strings to the same case and then compare them to see if they are the same. Instead, we can use the StringComparison class’s InvariantCultureIgnoreCase property. String.Equals(‘stringOne’,

Easily Create a String of Repeated Characters

Use the string class’s constructor to specify the character and the number of times you want it to be repeated. Listing 1. Repeat String Characters String repeatedCharacterString = new String(‘*’,50);

Change the Default TLS Version in .NET

.NET uses SSL3 as the default security protocol for communicating with vendor servers. You can override the default SecurityProtocol used in .NET by setting the TLS 1.2 version explicitly: ServicePointManager.SecurityProtocol

Exposing Internal Methods to Other Assemblies in .NET

The InternalsVisibleTo?attribute of System.Runtime.CompilerServices?class allows you to expose internal methods of one assembly to another. All you have to do is to specify this in the assemblyinfo.cs?file of the assembly

Get Stored Procedure Content and Details

The following query can be used to get details such as when the Stored Procedure was last updated???as well as its content. SELECT CREATED, LAST_ALTERED, SPECIFIC_NAME, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_DEFINITIONFROM lms_db.INFORMATION_SCHEMA.ROUTINES