Object initializers and Collection initializers in asp.net ?

Object initializer in asp.net, C#.net 4.0 features. Object initializers is one of the most important feature of C # 3.0.What is Object initializers?Using Object initializers we can initialize a object of that type without explicitly invoking the constructor of that particular type. Object initializers:I will explain this with a piece of code:class Student{    public … Read more

What is Nullable types in C#

What is nullable type in C# code? Please explain with an example. Nullable types were introduced in C# 2.0.Nullable types are instances of the System.Nullable<T> struct. A nullable type can represent the range of values for its underlying data type, also an additional null value. For example, a Nullable<Int32>, pronounced “Nullable of Int32,” can be … Read more

Executing Server side code in sharePoint or use of PageParserPath

Executing Server side code in sharePoint or use of PageParserPath Application pages in sharepoint behave like asp.net pages where they may contain inline server code.  Wheras site pages are rendered as safe mode parser so there is no problem with these type of pages.The problem comes with application pages i.e. asp.net pages. SharePoint will not … Read more

Bulk copy data from excel sheet to sql table

How to process bulk copy data from excel sheet to sql table. Here is code to copy data from excel to sql.       C# Code:       string excelFile = @”C:Book1.xls”;        string ssqlTable = “[MyTableName]”;        string exceldataQuery = “select [id],[email],[status] from [Sheet1$]”;        try    … Read more