Posts

Showing posts from March, 2011

SQL SERVER – Find Nth Highest Salary of Employee – Query to Retrieve the Nth Maximum value

How to get 1st, 2nd, 3rd, 4th, nth topmost salary from an Employee table The following solution is for getting 6th highest salary from Employee table , SELECT TOP 1 salary FROM ( SELECT DISTINCT TOP 6 salary FROM employee ORDER BY salary DESC) a ORDER BY salary You can change and use it for getting nth highest salary from Employee table as follows SELECT TOP 1 salary FROM ( SELECT DISTINCT TOP n salary FROM employee ORDER BY salary DESC) a ORDER BY salary where n > 1 (n is always greater than one) Same example converted in SQL Server 2005 to work with Database AdventureWorks. USE AdventureWorks; GO SELECT TOP 1 Rate FROM ( SELECT DISTINCT TOP 4 Rate FROM HumanResources.EmployeePayHistory ORDER BY Rate DESC) A ORDER BY Rate GO

.Net FAQ

Difference between a.Equals(b) and a == b If both a and b are value type then then you will get same result in a.Equals(b) and a == b. but in case of reference type both behaves differently : eg. string a = new string(new char[] {'d', 'a', 'n', 'c', 'e'}); string b = new string(new char[] {'d', 'a', 'n', 'c', 'e'}); object c = a; object d = b; Console.WriteLine (a==b); Console.WriteLine (a.Equals(b)); Console.WriteLine (c==d); Console.WriteLine (c.Equals(d)); } } Output will be; True True False True FAQ Master page events Events Master Page Child Control Initialization Content Page Child Control Initialization Master Page Initialization Content Page Initialization Content Page Load Master Page Load Master Page Child Controls Load Content Page Child Controls Load How IIS Process ASP.NET Request http://www.dotnetfunda.com/articles/article821-beginners-guide-how-iis-process-aspnet-request-.aspx http://compute

What is CLR,CLS,CTS,MSIL,JIT??

What is a .Net Assembly? The .NET assembly is the standard for components developed with the Microsoft.NET. Dot NET assemblies may or may not be executable, i.e., they might exist as the executable (.exe) file or dynamic link library (DLL) file. All the .NET assemblies contain the definition of types, versioning information for the type, meta-data, and manifest. The designers of .NET have worked a lot on the component (assembly) resolution. There are two kind of assemblies in .NET: private shared Private assemblies are simple and copied with each calling assemblies in the calling assemblies folder. Shared assemblies (also called strong named assemblies) are copied to a single location (usually the Global assembly cache). For all calling assemblies within the same application, the same copy of the shared assembly is used from its original location. Hence, shared assemblies are not copied in the private folders of each calling assembly. Each shared assembly has a four part name including

Sharepoint 2010 Virtual lab

Sharepoint 2010 Virtual lab MSDN Virtual Lab: SharePoint Server 2010: Advanced Search Security New! MSDN Virtual Lab: SharePoint Server 2010: Configuring Search UIs New! MSDN Virtual Lab: SharePoint Server 2010: Content Processing and Property Extraction New! MSDN Virtual Lab: SharePoint Server 2010: Developing a Custom Connector New! MSDN Virtual Lab: SharePoint Server 2010: Fast Search Web Crawler New! MSDN Virtual Lab: SharePoint Server 2010: Federated Search New! MSDN Virtual Lab: SharePoint Server 2010: Linguistics New! MSDN Virtual Lab: SharePoint Server 2010: People Search Administration and Management New! MSDN Virtual Lab: SharePoint Server 2010: Relevancy and Ranking New! MSDN Virtual Lab: Customizing MySites MSDN Virtual Lab: Designing Lists and Schemas MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010 MSDN Virtual Lab: Developing a Sandboxed Solution with Web Parts MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010 M

Publish a .NET 3.5 Website to Windows Server 2008 IIS 7

Publish a .NET 3.5 Website to Windows Server 2008 IIS 7 Install the Web Server Role •In Role Services, select ASP.NET and continue. Install the .NET 3.5 Framework •On your webserver, install the .NET 3.5 framework. Publish Your Application •In Visual Studio, publish your web project to a local folder, like on the desktop. •Copy that folder to a local folder on the webserver, maybe somewhere like c:\apps. •From the IIS Manager, right click your Default Web Site and "Add Application". I ran the "Test Settings" button and there was an authorization warning but I continued on. Enable ASP.NET Impersonation on your Website •If you're using Forms authentication, I think it's necessary to enable this setting, otherwise your permissions aren't in effect and anyone can browse anywhere. •IIS -> Your website -> Authentication -> Enable ASP.NET Impersonation. Test your Application •Open a browser, and try http://localhost, verify that the IIS 7 page comes up

Exploring the Global.asax file in ASP.NET

Exploring the Global.asax file in ASP.NET Have you ever felt the need of writing logic at the application level; precisely a location or a file where you could handle events or errors at the application level? Well if yes, then enter the Global.asax. Using this file, you can define event handlers with application-wide or session-wide scope. In this article, we will explore the application and session level events exposed in the Global.asax file and how we can utilize these events in our applications. The Global.asax, also known as the ASP.NET application file, is located in the root directory of an ASP.NET application. This file contains code that is executed in response to application-level and session-level events raised by ASP.NET or by HTTP modules. You can also define ‘objects’ with application-wide or session-wide scope in the Global.asax file. These events and objects declared in the Global.asax are applied to all resources in that web application. Note 1: The Global.asax is a

Asp.net links

Save and Retrieve Images from the Database using ASP.NET 2.0 and ASP.NET 3.5 Exploring the Global.asax file in ASP.NET Cross Page Posting In ASP.NET 2.0

LINQ to SQL Full

LINQ to SQL Part 1: Introduction to LINQ to SQL Part 2: Defining our Data Model Classes Part 3: Querying our Database Part 4: Updating our Database Part 5: Binding UI using the ASP:LinqDataSource Control Part 6: Retrieving Data Using Stored Procedures Part 7: Updating our Database using Stored Procedures Part 8: Executing Custom SQL Expressions

Installing SharePoint Server-2010

Installing SharePoint Server-2010 1)How to install SPS2010 in Single Box Development Server? 2)Create a Sharepoint 2010 VM in 32 bits host machine Download doc for details 1)How to install SPS2010 in Single Box Development Server? 1. After you have finished installing OS, start to add Active Directory Domain Service roles. Complete the installation procedure and configure the roles. 2. Then, start to add Application Server and Web Server roles. This installation is straight forward, and you will be easily get your Application Server and Web Server roles configured in the machine. 3. Install SQL Server 2008 SP1 + CU KB970315 Download SQL Server 2008 SP1 here: http://www.microsoft.com/downloads/details.aspx?familyid=66AB3DBB-BF3E-4F46-9559-CCC6A4F9DC19&displaylang=en Download CU KB970315 here: http://support.microsoft.com/kb/970315 And here is the tricky part, installing SPS2010 4. Extract SPS2010 installer to a folder /extract:e:\sps2010 That command will