Programming360

Creating Understanding and Educating Programmers, Developers and Technical Communities, one post at a time.

Wednesday, June 22, 2016

.Net Framework Version

Run this command in command prompt.

dir %windir%\Microsoft.NET\Framework/AD

Thursday, May 2, 2013

Find Text in Stored Procedures

Method to retrieve every text inside the stored procedures of a database
SELECT B.Name, *
FROM syscomments A INNER JOIN sysobjects B
ON A.id = B.id
WHERE A.text like '%tblNames%'
Reference: http://geekswithblogs.net/whiletrue/archive/2009/02/02/find-text-in-sql-stored-procedures.aspx

Tuesday, April 16, 2013

Static Constructor in C#

In C#, static constructor is always private and it does not need explicit access modifier, it does not take parameters and only good for initialization of static members of class. Static constructor calls before first instance of class's object and user does not really have any control on it.

Singleton pattern also take the advantage of static constructor of C#.

Thursday, March 21, 2013

AutoEventWireup

If autoeventwireup=true, ASP.NET page events will automatically subscribe to respective life cycle event. An special hash table behind the scene maintains the match. :)

Thursday, April 12, 2012

ABC of WCF

WCF service exposes endpoints and each endpoint contain address, binding and contract.

Address: Where the service communicate and points to actual network address.
Binding: How service communicate and includes protocol.
Contract: What the message contain.

Wednesday, November 9, 2011

Language Integrated Query

LINQ api provide a way to access Object Data, Relational Data, and XML Data. System.LINQ defines more than 50 operators(also called standard query operator and can also be extendable) which are similar to SQL operators. Static type checking allows the assignment of selected result in correct IEnumerable object.

It was also misunderstood in early days of LINQ concept that only database is accessible from API. LINQ can used with any data object which are in main memory. It is really easy to use LINQ and filter item in list instead of writing foreach code and then apply if else conditions.

LINQ to SQL translates query expression into T-SQL It is simple ORM.

Some cool facts about LINQ.

LINQ query does not execute until it is actually use/access by code. This concept is called Deferred Execution. So most operators are lazy.