The slideToggle() method toggles between the slideUp() and slideDown() methods. If an element is slid up, slideToggle() will slide it down and vice versa. Syntax $(selector).slideToggle(speed,callback); Example $("div").slideToggle();
Dangling Pointers in C++
Dangling pointers Dangling pointers arise when an object is destroyed. Despite being deleted or de-allocated, it still has an incoming reference because the value of the pointer was not modified. The pointer still points to the memory location of the de-allocated memory. AVOID DANGLING POINTERS It is easy to avoid dangling pointer errors by setting the pointer to NULL... Continue Reading →
Pointers
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 →
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
Convert Excel file to PDF using Gembox.Spreadsheet in C#
in Header using GemBox.Spreadsheet; CODE var workbook = ExcelFile.Load("ContactNumbers.xlsx"); workbook.Save("Convert.pdf"); Yes, it is that simple to convert excel file to pdf in C#
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.
Stored procedure to fill data that needs to be populated in dropdownlist in MVC Application
STORED PROCEDURE USE [DB_obj] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[sp_FillUserRoles] -- Add the parameters for the stored procedure here AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * from... Continue Reading →