How can you format a number to n decimal places like if you have a number like 123.1234567 and you want it to be formatted to 123.12 , just 2 decimal places. You can do that in C# using the ToString() as shown below. There are at least two ways of doing it. Here it is.
What is a Sealed Class?
Sealed Class in C# is a feature by which you can restrict your class being inherited by other classes. So if you don’t want your class to be used as a base class to be derived from, then use the Sealed feature.
Warning: new protected member declared in sealed class
FileStream allows you to store unstructured data (LOB) in the file system instead of the database.
The following errors were encountered while processing the workflow tree:
'Literal<DataRow>': Literal only supports value types and the immutable type System.String. The type System.Data.DataRow cannot be used as a literal.
File Splitter Utility in C#
I had to come across a situation where I had to cut a large single .csv file containing 2.2 Million records into smaller files. Initially I thought of using already available split tool to do it, but then decided to write my own File Splitter tool in C#. Thats how I came up with this tool. The File Splitter Tool takes an input file and splits it into multiple files each containing the number of records you specify. Here is the source code for the tool.
We find both bool and Boolean types in C#. It just made me wonder if there is any difference between the two types. It appears there is no difference between the two as both Represent the Boolean Type. So bool is just an alias to the System.Boolean type.
As you use StreamReader to manipulate Text files and read one line at a time using Readline() Method you might come across a situation where you are somewhere in the middle of the Stream say on the 5th line and want to go back to the begin of the Stream. You can do that using the Seek Method on the BaseStream of the StreamReader as in this example.
C# Statements Syntax Reference