Posts

LINQ to SQL LIKE Operator

Image
LINQ to SQL LIKE Operator By using Contains(), StartsWith(), EndsWith() we can implement LIKE operator in LINQ to SQL. like '%SearchString%' = Contains("SearchString") like '%SearchString' = StartsWith("SearchString") like 'SearchString%' = EndsWith("SearchString") Input tables Employees table LINQ Query Contains(): MyDBDataContext  sqlObj =  new   MyDBDataContext (); var  employees =  from  emps  in  sqlObj.tblEmployees                  where  emps.EmployeeName.Contains( "en" )                  select   new                 {                     emps.EmployeeID, ...

Sharepoint Event Receivers

 http://ramdotnetdeveloper.blogspot.in/2014/12/event-receivers-in-sharepoint-2010.html

Sealed Class

Sealed class is used to define the inheritance level of a class. The sealed modifier is used to prevent derivation from a class. An error occurs if a sealed class is specified as the base class of another class. Some points to remember:       1.  A class, which restricts inheritance for security reason is declared, sealed class. 2.  Sealed class is the last class in the hierarchy. 3.  Sealed class can be a derived class but can't be a base class. 4.  A sealed class cannot also be an abstract class. Because abstract class has to provide functionality and here we are        restricting it to inherit. Practical demonstration of sealed class using  System; using  System.Collections.Generic; using  System.Linq; using  System.Text; namespace  sealed_class {      class   Program     {       ...

Interface and Abstract

Interface  Implementing an interface consumes very little CPU, because it's not a class, just a bunch of names, and therefore there is no expensive look-up to do Following are the difference between the Classes and Interface The interfaces are used in java or .net to implementing the concept of multiple inheritance whereas classes are not used to implement multiple inheritance. We are not allocating the memory for the interfaces whereas the memory is allocated for the classes Interfaces are always implemented whereas classes are always extended  public interface IA         {             void fun();             void funb();         }         public interface IB         {    ...

OOPS In C#

Object Oriented Programming (OOP) concepts Abstraction  Encapsulation  Inheritance Polymorphism OOP Features The software is divided into a number of small units called objects. The data and functions are built around these objects. The data of the objects can be accessed only by the functions associated with that object. The functions of one object can access the functions of another object Class ·          A class is the core of any modern Object Oriented Programming language ·          A class is a blueprint of an object that contains variables for storing data and functions to perform operations on the data.  ·          A class will not occupy any memory space and hence it is only a logical representation of data. Example class Employee {   } . Object An object is a software bundle o...