Declaration of a pointer int *p; int a=10; int is not the datatype of pointer as pointer points to the address of the memory location. Therefore, it is the data type of the content stored at that address. *p is how you declare the pointer. Just like you declare any other variable (say p as... Continue Reading →

Var versus object vs dynamic in C#

These 3 types are used to store any type of data in C#. It means type of variable is decided at the compile time by the compiler and it has all information about the stored value to avoid any sort of issue at run-time. But what are the differences? You can find the differences in... Continue Reading →

Boxing and Unboxing in C#

Boxing Boxing means to convert any value-type to object type or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object instance. In the following example,object o is boxing the integer first. int first=345; object o=first; UNBoxing Unboxing extracts or unwraps the value-type from... Continue Reading →

Difference between where and having clause

Having clause is used after group by clause whereas where clause is used before group by clauseHaving clause is used to filter the groups and where clause is used to filter rows Syntax select customer_id,Count(*) as visits from Customer_Info where age>25 group by customer_id having Count(*)>10

Copy Constructor

It is a constructor that creates an object by copying variables from another object of same class or we can simply say that it copies the data from one object into another object of the same class. It is a parameterized constructor that contains a parameter of the same class type. Syntax Teacher(const Teacher & obj){}

Convert Excel files to HTML in C#

var workbook = ExcelFile.Load("officeDials.xlsx"); var worksheet = workbook.Worksheets[0]; worksheet.PrintOptions.PrintHeadings = true; worksheet.PrintOptions.PrintGridlines = true; worksheet.NamedRanges.SetPrintArea(worksheet.Cells.GetSubrange("A2", "C33")); var options = new HtmlSaveOptions() { HtmlType = HtmlType.Html, SelectionType = SelectionType.EntireFile }; workbook.Save("officeDials.html", options);

Read XLS file by using the GemBox.Spreadsheet.NET component.

var workbook = ExcelFile.Load("MyWorkbook.xls"); var worksheet = workbook.Worksheets.ActiveWorksheet; MessageBox.Show(worksheet.Cells["A1"].GetFormattedValue()); EXPLANATION Excel file will be loaded.Active worksheet will be selected.The value of first cell in MessageBox will be displayed.

Blog at WordPress.com.

Up ↑

Create your website at WordPress.com
Get started