DataReader vs DataSet vs DataAdapter vs DataTable

DataReader : DataReader is used to read the data from database and it is a read and forward only connection oriented architecture during fetch the data from database. DataReader is used to iterate through resultset that came from server and it will read one record at a time because of that memory consumption will be … Continue reading DataReader vs DataSet vs DataAdapter vs DataTable

How to use profiler on windows application

To optimize our applications we use Profilers.There are many profilers available on the web. But miniprofiler is the good one and it's not cost you any bucks. I recently faced a situation where I have to check the memory cunsomption by my console application to further optimize it. So I used an extended version of … Continue reading How to use profiler on windows application

What is HTML5 Web Storage? localStorage and sessionStorage.

With HTML5, web pages can store data locally within the user’s browser. Earlier, this was done with cookies. However, Web Storage is more secure and faster. The data is not included with every server request, but used ONLY when asked for. The data is stored in name/value pairs, and a web page can only access … Continue reading What is HTML5 Web Storage? localStorage and sessionStorage.

Lazy, Eager, and Explicit Loading

There are several ways that the Entity Framework can load related data into the navigation properties of an entity: Lazy loading. When the entity is first read, related data isn't retrieved. However, the first time you attempt to access a navigation property, the data required for that navigation property is automatically retrieved. This results in … Continue reading Lazy, Eager, and Explicit Loading

Deferred vs Immediate Query Execution in LINQ

There are two ways of LINQ query execution as given below: Deferred Execution In case of differed execution, a query is not executed at the point of its declaration. It is executed when the Query variable is iterated by using loop like as for, foreach. DataContext context = new DataContext(); var query = from customer … Continue reading Deferred vs Immediate Query Execution in LINQ

IEnumerable Vs IQueryable

IEnumerable  IQueryable Namespace System.Collections Namespace System.Linq Namespace Derives from No base interface Derives from IEnumerable Deferred Execution Supported Supported Lazy Loading Not Supported Supported How does it work IEnumerable is suitable just for iterate through collection and you can not modify (Add or Remove) data IEnumerable bring ALL data from server to client then filter … Continue reading IEnumerable Vs IQueryable

How to get all Stored Procedure modified/created in last N days

I recently come through a situation where I forgot the name of the procedure modified by me few days back. After a search from Google I found many solutions and decided to put them on one place . For modified stored procedures : SELECT name,create_date, modify_date FROM sys.objects WHERE type = 'P' AND DATEDIFF(D,modify_date, GETDATE()) < … Continue reading How to get all Stored Procedure modified/created in last N days

How to export results in to a file in SQL server 2008

Recently I countered a situation where I need to insert a bulk amount of data from a table in one database to another alias table in other database. For bulk insert I found out many solutions and this works for me correctly. But before that I need to export the data to a file, for … Continue reading How to export results in to a file in SQL server 2008