Getting Started With Windows Server 2016

Getting Started With Windows Server 2016 Recently I got the opportunity to build one Windows Server at my workplace so I am going to share my experience. Please note that I am not an expert into building server, this is my first step towards building one. Basic Configuration Steps 1. Open server rack to verify […]

ASP.NET MVC – Controllers

Controllers The controller is responsible for the request made by the browser, each request is mapped to a particular controller. The controller can return a view or redirect to another controller. The controller is just a class derived from the base System.Web.Mvc.Controller class. Controller Actions Action is a method on a controller which gets called […]

C# – Working with Excel

Working with Excel Library Include using Excel = Microsoft.Office.Interop.Excel Instantiating the excel application class Excel.Application excelApp = new Excel.Application(); To make the object visible excelApp.Visible = true; //false to turnoff visibility Add a workbook Excel.Workbook openExcel = excelApp.Workbooks.Add(Type.Missing); or to add an existing excel file var path = @”C:\\excel.xlsx”; Excel.Workbook openExcel = excelApp.Workbooks.Open(path); To add […]

C# – LINQ to read XML

LINQ to read XML Loading the XML File XElement and XDocument derive from XContainer. 1. XElement class Reads the XML elements (attributes and children) Implements IXmlSerializable. XElement xelement = XElement.Load(file); IEnumerable employees = xelement.Elements(); //Read the entire XML foreach(var employee in employees) { Console.WriteLine(“Reading Employee: == ” + employee); } 2. XDocument class Reads the […]

Gayatri Mantra

Gayatri Mantra A Universal Prayer enshrined in the Vedas: Om Bhur Bhuvaḥ Swaḥ Tat-savitur Vareñyaṃ Bhargo Devasya Dhīmahi Dhiyo Yonaḥ Prachodayāt According to the Vedas: Chanting the Gayatri Mantra purifies the chanter Listening to the Gayatri Mantra purifies the listener Meaning: gaya: – vital energies tri: – preserves, protects, gives deliverance, grants liberation Word meaning: […]

Measuring Execution Times

Measuring Execution Times The SQL Server Management Studio shows query measurement time in seconds. If we are concern about performance then in-depth measurement is required such as milliseconds. Using Statistics set statistics time on — your query set statistics time off Messages Tab SQL Server parse and compile time: CPU time = 67 ms, elapsed […]

C# – LinkedList

LinkedList LinkedList<T> is a generic doubly linked list. Doubly linked list is a chain of nodes in which each references the node before, the node after and the actual element. Benefit – element can always be inserted efficiently anywhere in the list, since it just involves creating a new node and updating a few references. […]

C# – Encapsulation

Encapsulation Is about creating a boundary around an object to separate its public and private implementation details in the class file. Example public class Contact { private string fname; private string lname; private string emailaddr; private string phoneno; private string addr; private string cname; private byte[] photo; private DateTime dob; public string FirstName { get […]

Classes and Objects

Classes and Objects Classes Classes and objects are used everywhere in C# and .Net framework. Class is a blueprint of creating a type which groups data and behavior of a type. Class contains properties, methods and events. Object Is a instance of a class. public class Employee { … } Employee obj = new Employee(); […]