Friday, 2 January 2015

Sql Server Stored Procedure Performance Tuning


Now a days as user base is growing so does the problem of data management. We all face performance related problems while performing sql data operations, so mentioned below are some of the tips you can consider while fetching data using sql server:

1. Fetch Only Required Columns: Rather than fetching all the columns try to fetch columns which are needed by your application i.e.
         Replace,
                   Select * from table 
        With,
                   Select col1, col2, col3 from table

Sunday, 27 July 2014

Interview Questions

If you are struggling to get placed in a reputed organization but not able to get through the ugly and tough interviews then try below questions and find yourself sipping coffee and relaxing in cafeteria of big brands like Infosys, IBM, Wipro, RBS and so on. Lets not waste much time dreaming and get directly to questions.

Q1: Define Static Members in C#
A1:If an attributes value had to be same across all the instances of the same class , static keyword is used. For example if the Minimum salary should be set for all employees in the employee class, use the following code
private static double MinSalary = 30000;
For static members only single memory space will be shared by all instances. When to use static member depends upon the requirement If there are certain values that needs to be same across all instances i.e that doesn't depends upon the particular instance/user like web config keys, utilities values, logging details etc  for this we can use static members.

Monday, 14 July 2014

Project not selected to build for this solution configuration


You can create several build configurations for a solution. For example, you can configure a debug build that your testers/developer can use to find and fix problems, and you can configure different kinds of builds that you can distribute to different customers. 

When you upgrade your older solution files to latest version of visual studio 2010 or 2012 you may get compilation output as "Project not selected to build for this solution configuration", even though with the earlier version of visual studio these projects were building fine. 

 In order to build required project you just have to modify the solution configuration. Steps below mention how to do it.

Wednesday, 25 June 2014

MVC Basics Part 1



In this post we will be getting basic idea about MVC. Whenever I head MVC the very first question that came to my mind is what actually MVC is? and from here my search started but now I have gained enough knowledge about MVC that I will directly start with it without taking much time of yours.

What actually MVC is
ASP.NET MVC is a design pattern or a software architecture that separates domain/application/business logic from the rest of the user interface. It does this by separating the application into three parts: the model, the view, and the controller. To understand the distinctive aspects and design goals of ASP.NET MVC, it’s worth considering the history of Web development so far—brief though it may be.

Saturday, 8 March 2014

Create Or Edit Word Document in C# using a given document Template

Generally, there is a need to create a document based on some template document dynamically using c# , hence, the search on internet starts for an optimum solution.So here you are, at the right place where we cater all appropriate and feasible solutions to your queries.Probing towards the technical part :

Source Code for Project can be downloaded at Document Generator Source Code

1) There are number of ways to perform this task but here we will be using Open XML for creating and editing documents in C#, OpenXML is widely used for creating/updating Office documents. It has a predefined structure of XML for document. 


Sunday, 23 February 2014

Interview Questions On Assemblies In .NET

Interview Questions On Assemblies In .NET

Q: What is GAC (Global Assembly Cache)?
A: GAC is a central repository folder where you can store and share your DLL among different applications running in the same computer. So for example you have accounting and invoicing application running in the same computer and both these application need some common utility like the logging DLL then you need to register them in GAC and share with them this dll from one common location instead of referencing the logging dll from logging project bin directory.

Q: If we have different versions of DLL in GAC how can the application identify them?
A: This is done by using binding redirect and specifying older version and new version value. So which ever version you put in the new version will be used by the application. 
  

Saturday, 22 February 2014

Assemblies in .NET

Assemblies in .NET

Introduction:

  1. In the Microsoft .NET framework, an assembly is a partially compiled code library for use in deployment, versioning and security. There are two types: process assemblies (EXE) and library assemblies (DLL). A process assembly represents a process which will use classes defined in library assemblies. .NET assemblies contain code in CIL, which is usually generated from a CIL language, and then compiled into machine language at run time by the CLR just-in-time compiler.
  2. An assembly can consist of one or more files. Code files are called modules. An assembly can contain more than one code module and since it is possible to use different languages to create code modules it is technically possible to use several different languages to create an assembly. Visual Studio however does not support using different languages in one assembly.
  3. When you compile an application, the MSIL code created is stored in an assembly . Assemblies include both executable application files that you can run directly from Windows without the need for any other programs (these have a .exe file extension), and libraries (which have a .dll extension) for use by other applications. Assemblies can be Process Assemblies i.e exe files or Library Assemblies i.e dll files. Process assemblies are the processes which use library assemblies in their execution.
  4. Even though assembly  word can be used for EXE's as well but it mainly refers to Dll's. Assemblies are also called Portable Executable s (PE) as they can be easily carried and executed on any other system having CLR installed.