Generally, We use SQL Where .. IN Statement to determine whether a specified value matches ANY value in a sub-query or a list. But sometimes we require to get data which have ALL specified values, not ANY value. In this post, we’ll see how to accomplish it. Let’s take an example, Consider following data in Orders table
Month: February 2012
Implement Audit Trail Quickly for Microsoft SQL Server
It explains how to implement an audit trail quickly by creating shadow table for each table in database and triggers to log every time when a record is inserted, updated or deleted in the table.
3 Ways to implement CRUD (Select, Insert, Update, Delete) Operations
CRUD (Create, Read, Update, and Delete) are the four basic and essential database operations of an application. There are different ways to design to implement CRUD operations. In this article, You’ll see 3 most widely used approaches in web application.
3 Practical Uses of Zen Coding
You must know Zen Coding if you are Front End Web developer. Zen coding allows for fast coding and editing in HTML, XML, XSL, and other structured code formats. It uses CSS selectors like syntax and generate full code(write less do more). It expands abbreviations into complete HTML structures. Zen coding plugin is available for almost all top text editors(Notepad++, visual studio, Dreamweaver , TextMate, Sublime Text, Coda, Vim ..etc). In live demo, First write abbreviations and press Ctrl+, to expand abbreviations.
Anonymous Type LINQ Result and GridView Sorting in ASP.NET
It explains how to implement asp.net gridview sorting functionality when gridview datasource is Anonymous Type. Suppose you are using Entity Framework OR LINQ to sql, getting data with a particular structure having different columns from different tables (Anonymous Type) using LINQ and you have defined it as a datasource of gridview. It’s okay to display data. Now, you have to implement sorting feature. One way is to convert Anonymous Type to Datatable and sort it defaultview, but it’s too complex. You might have tasted dynamic sorting with extension method as mentioned here and here but not useful for Anonymous type. Another way is to use switch case for sortexpression and use OrderBy and OrderByDescending for each column. It’s not a generalize solution. then what….???