Posts

Showing posts from September, 2014

Static class in C#

C# provides the important feature to create static classes, there are two main features of a static class, one is no object of static class can be created and another is, a static class must contain only static members, then it is important that what is the main benefit to create a static class, the main benefit of making static class, we do not need to make any instance of this class ,all members can be accessible with its own name. Declaration: A static class is created by using keyword 'Static' as shown here: Static class   Clasname {      //C# } One more thing that is notable-within static class, all members must be explicitly specified as static, static class does not automatically make its members static. Static class can contain a collection of static methods. Example: using   System; static   class   Shape {       public   static   double   GetArea( double   Width,   double ...

What is a Stored Procedure

Image
  They are one or more SQL programs stored in a database as an executable object. They can be called interactively, from within a client application or from another stored procedure and from within triggers. We can pass parameters to and return from stored procedures to increase their usefulness and flexibility. A stored procedure can return a number or result set and a status code. Advantage of using Stored Procedure: Modular Programming: Stored procedures are modular. This is a good thing from a maintenance standpoint. When query trouble arises in your application, you would likely agree that it is much easier to troubleshoot a stored procedure than an embedded query buried within many lines of GUI code.   Function based access to tables: A user can have permissions to execute a stored procedure without having permission to operate directly on the underlying tables.   Reduced network traffic: Stored procedures   can consists of many individual SQL queries but...