<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gateway Technolabs Blog</title>
	<atom:link href="http://www.gatewaytechnolabs.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gatewaytechnolabs.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 05:45:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Things To Consider While Using SQL Server Reporting (SSRS)  With Silverlight (3 and 4)</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/08/things-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/08/things-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 05:45:32 +0000</pubDate>
		<dc:creator>Nishith Desai</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=433</guid>
		<description><![CDATA[
			
				
			
		
Reporting is the heart of most business applications. And SQL Server Reporting Service (SSRS) is a preferred choice while MSSQL Server is the database back-end. Apart from ready to use services, SSRS provides different and useful scalability and extensibility options.
On the other end, lately, MS Silverlight has generated positive heat amongst varied business applications.
So you [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F08%2Fthings-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F08%2Fthings-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Reporting is the heart of most business applications. And SQL Server Reporting Service (SSRS) is a preferred choice while MSSQL Server is the database back-end. Apart from ready to use services, SSRS provides different and useful scalability and extensibility options.</p>
<p>On the other end, lately, MS Silverlight has generated positive heat amongst varied business applications.</p>
<p>So you got the point. I’m talking about the marriage between <a href="http://en.wikipedia.org/wiki/SQL_Server_Reporting_Services" target="_blank">SSRS</a> and <a href="http://silverlight.net/" target="_blank">Sliverlight</a>.</p>
<p>It started with challenges as the whole concept was an unknown devil which we were able to tame in the end.</p>
<p>The problem was simple &#8211; Microsoft doesn’t have any SSRS report-viewers for Silverlight &#8211; but its impact was not so. Initially, it was apparent that we cannot use SSRS with Silverlight.</p>
<p>So, I Googled (and then Bingged also &#8211; both the technologies are from Microsoft <img src='http://www.gatewaytechnolabs.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) to find out the following two possibilities out of my one hour of investment:</p>
<ol>
<li>Use Third Party Report Viewer Controls</li>
<li>Use ASP.NET application and invoke it from Silverlight application</li>
</ol>
<p>Each option has its own distinctions. Here are those:</p>
<ol>
<li><strong>Third Party controls: </strong>We can use third party report viewers which support SSRS reports. Right now there is only one such software provider <a href="http://www.perpetuumsoft.com/Silverlight-Viewer-for-Reporting-Services.aspx">Perpetuum Software</a> is available. They provide SSRS report viewer for Silverlight which is also Silverlight 4 ready. There are other report viewers provided by other major component providers like Telerik however they do not support SSRS reports at present. Instead, they support their own reporting ways from within Silverlight application.</li>
<li><strong>ASP.NET Application: </strong>In this approach, we have to create an ASP.NET web application for hosting SSRS reports. The web application will use default report viewer control. To integrate this web application into the Silverlight application there are two possible options as below:
<ol>
<li><em>Using Html Viewer: </em>We can use HtmlViewer control to view reports hosted as an ASP.NET web application. Though, Silverlight 3 does not have in-built html viewer control, there are third party controls available like one from Telerik. The good news is that Silverlight 4 does have in-built html viewer control.</li>
<li><em>Using JavaScript: </em>We can use client side JavaScript functions to open new window or IFRAME from within Silverlight application which will show reports hosted as an ASP.NET web application.</li>
</ol>
</li>
</ol>
<p>I am sure Microsoft will come up with a better solution to this problem in the coming days. Until that any of the above options can be used. I used option #2 – ASP.NET application &#8211; considering the client needs of flexibility and it worked well.</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/08/things-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/08/things-to-consider-while-using-sql-server-reporting-ssrs-with-silverlight-3-and-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Something about NULL in SQL Server</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/08/something-about-null-in-sql-server/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/08/something-about-null-in-sql-server/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 10:20:36 +0000</pubDate>
		<dc:creator>bthaker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=496</guid>
		<description><![CDATA[
			
				
			
		
As developers, we all probably know what a NULL is in SQL Server. NULL is not a specific value but it stands for UNKNOWN value. In other words, NULL represents the ‘absence of data’.
The behavior and treatment of NULL in SQL server is very interesting in different context and part of T-SQL language. Let’s have [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F08%2Fsomething-about-null-in-sql-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F08%2Fsomething-about-null-in-sql-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As developers, we all probably know what a NULL is in SQL Server. NULL is not a specific value but it stands for UNKNOWN value. In other words, NULL represents the ‘absence of data’.</p>
<p>The behavior and treatment of NULL in SQL server is very interesting in different context and part of T-SQL language. Let’s have a quick look on how it is treated in different ways by SQL Server.</p>
<p>When you use NULL (UNKNOWN value) in Arithmetic operations or in String Concatenation operations, the result is always UNKNOWN because the value which is being operated is not available or UNKNOWN. So, all the following statements yield the result of NULL:</p>
<blockquote><p><code>SELECT 5 + NULL<br />
SELECT 10 / NULL<br />
SELECT 'Gateway' + ' Technolabs' + NULL</code></p></blockquote>
<p>So beware when you are trying to do something similar as shown below:</p>
<blockquote><p><code>DECLARE @TOP INT<br />
DECLARE @SQL NVARCHAR(100)<br />
SET @SQL = 'SELECT TOP ' + CAST(@TOP AS VARCHAR(10)) + '* FROM HumanResources.Employee'<br />
EXECUTE SP_EXECUTESQL @SQL</code></p></blockquote>
<p>The above query will never execute. Guess why?  Because you forgot to initialize @TOP variable and due to that it will contain NULL. So when you try to concatenate the value of @TOP with the value of @SQL, the resulting query is UNKNOWN.</p>
<p>Unlike other programming languages, SQL Server follows the rules of “Three-Valued Logic” which means that the result of a condition in T-SQL can have any of three possible values viz. TRUE, FALSE and UNKNOWN. If NULL is one of the operands in condition composed of comparison operators like =,&gt;,&lt;,&gt;=,&lt;=,&lt;&gt;, then the result of the expression is NULL or UNKNOWN.  For example, the result of all of the following conditions is UNKNOWN:</p>
<p>&#8230; WHERE 100 = NULL</p>
<p>&#8230; WHERE NULL &gt; 5</p>
<p>&#8230; WHERE NULL &lt; 10</p>
<p>Even following statement yields NULL as per SQL-92 Standards:</p>
<p>&#8230; WHERE NULL = NULL</p>
<p>Let’s create a simple table and insert some records in it.</p>
<blockquote><p>
<code>CREATE TABLE tblPerson<br />
(<br />
PersonID INT<br />
,PersonName VARCHAR(50)<br />
,Age TINYINT<br />
)<br />
GO<br />
INSERT INTO tblPerson<br />
SELECT 1,'Person-1',25<br />
UNION<br />
SELECT 2,'Person-2',NULL<br />
UNION<br />
SELECT 3,'Person-3',35</code>
</p></blockquote>
<p>We have a table which contains three rows.  The second row has NULL in Age for Person-2. Now, execute the following query:</p>
<blockquote><p>
<code>SET ANSI_NULLS OFF<br />
SELECT * FROM tblPerson WHERE Age = NULL</code>
</p></blockquote>
<p>The above query will return 1 row for Person-2. Notice the use of SET ANSI_NULLS OFF which is not recommended way because it does not conform to SQL-92 standards. Microsoft encourages the usage of SET ANSI_NULLS ON which is considered best practice and which is also the default behavior of SQL Server. Now, consider following query:</p>
<blockquote><p>
<code>SET ANSI_NULLS ON<br />
SELECT * FROM tblPerson WHERE Age = NULL</code>
</p></blockquote>
<p>The result of the condition in WHERE clause in above query will be UNKNOWN. It is neither TRUE nor FALSE. But, in this case SQL server treats NULL as if “NOT EQUAL TO” and evaluates the result of the condition to FALSE and will not return any rows. Note the use of SET ANSI_NULLS ON, which is SQL Server default.</p>
<p>If you want to fetch rows where Age is NULL, you should use ‘IS’ operator with ANSI_NULLS set to ON instead of using ‘=’ operator with ANSI_NULLS set to OFF. So, the preferred query should be as follows:</p>
<blockquote><p>
<code>SET ANSI_NULLS ON<br />
SELECT * FROM tblPerson WHERE Age IS NULL</code>
</p></blockquote>
<p>As you can observe from above examples that using comparison operators (=,&lt;,&gt;,&gt;=,&lt;=,&lt;&gt;) in condition with NULL as one of its operands appearing in WHERE clause yields UNKNOWN result when you don’t specify ANSI_NULLS option or if it is set to ON.</p>
<p>But this is not the case when NULL appears in condition for a CHECK constraint. To see this, let’s add a CHECK constraint to our table so that age must be greater than zero when a record is inserted or updated.</p>
<blockquote><p>
<code>ALTER TABLE tblPerson<br />
ADD CONSTRAINT CK_tblPerson_Age CHECK (Age &amp;gt; 0)</code>
</p></blockquote>
<p>Now, add new row with NULL in Age as shown below:</p>
<blockquote><p><code>INSERT INTO tblPerson VALUES (4,'Person-4',NULL)</code></p></blockquote>
<p>The age for newly inserted row is NULL which is not greater than zero because it is UNKNOWN. But, SQL Server treats NULL differently in this case and evaluates the CHECK constraint condition as if it is TRUE and inserts new row to the table.</p>
<p>You saw that the condition WHERE NULL=NULL yields NULL because both the values are UNKNOWN and due to this comparison is not possible. Thus, the result will always be UNKNOWN. But again, this is not always the case. To prove my point, let’s add a UNIQUE constraint on PersonID column.</p>
<blockquote><p>
<code>ALTER TABLE tblPerson<br />
ADD CONSTRAINT UK_tblPerson_Age UNIQUE (PersonID)</code>
</p></blockquote>
<p>Now insert a new row where PersonID is NULL as shown below:</p>
<p>INSERT INTO tblPerson VALUES (NULL,&#8217;Person-5&#8242;,30)</p></blockquote>
<p>Because PersonID column allows NULL values, SQL Server will insert this new row. Now, try inserting one more row where PersonID is NULL:</p>
<blockquote><p><code>INSERT INTO tblPerson VALUES (NULL,'Person-6',35)</code></p></blockquote>
<p>As you may probably have guessed, because of UNIQUE constraint on PersonID SQL Server will not allow inserting another row with NULL for PersonID because tblPerson already contains one row with NULL in PersonID column. In this case, SQL server treats NULL even differently and considers all NULLs as if they are equal and does not allow a second NULL to be inserted. Even when SQL Server groups or orders rows by a column, it considers all the NULLs in one group as if they are all equal.</p>
<p>I hope this discussion will help many of you in understanding the behavior of NULL in SQL Server. Thank you for taking time to read this article. Readers’ valuable comments are always welcome!</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/08/something-about-null-in-sql-server/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/08/something-about-null-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Performance Enhancement Tips for LINQ Coupled With MSSQL Server</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/07/5-performance-enhancement-tips-for-linq-coupled-with-mssql-server/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/07/5-performance-enhancement-tips-for-linq-coupled-with-mssql-server/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 06:27:38 +0000</pubDate>
		<dc:creator>Kalpesh Patel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=459</guid>
		<description><![CDATA[
			
				
			
		
LINQ is one of the most exciting enhancements made in the Microsoft.NET languages in the recent years.
Essentially, it’s a new way to represent different data models in OOPs notation.
While working extensively with LINQ in last couple of years on mission critical .NET projects, I’ve observed the following five performance enhancement possibilities.
1. Lazy Loading &#38; Eager [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2F5-performance-enhancement-tips-for-linq-coupled-with-mssql-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2F5-performance-enhancement-tips-for-linq-coupled-with-mssql-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" target="_blank">LINQ</a> is one of the most exciting enhancements made in the Microsoft.NET languages in the recent years.</p>
<p>Essentially, it’s a new way to represent different data models in OOPs notation.</p>
<p>While working extensively with LINQ in last couple of years on mission critical .NET projects, I’ve observed the following five performance enhancement possibilities.</p>
<h3><strong>1. Lazy Loading &amp; Eager Loading </strong></h3>
<p><strong>Lazy Loading:</strong></p>
<p>By default LINQ loads the related objects lazily. Lazy loading means Loading Object with that associate Objects.</p>
<p>For example, If I have two tables called User (UserId, Name) and User_Car  (UserId, CarID, CarBrand), whenever we initiate a User object, it will automatically load User_Car object details also as shown in the code below.</p>
<pre>
<code>var userObj = from user in DataContext.User
              Select user;</code>
</pre>
<p>The above query returns the User Object with the details of associate object of User_Car.  E.g.</p>
<pre><code>Int carId= userObj.User_Car.CarID;</code></pre>
<p>The above statement will fire two queries on database.</p>
<p>First one will be fired when we write query on User Object. E.g.</p>
<pre><code>var userObj = from user in datacontext.User
              Select user;
(Select ID, Name from User)</code></pre>
<p>And second query will fired when we try getting the value from User_Car object.</p>
<p>E.g</p>
<pre><code>Int carId=userObj.User_Car.CarID;
(Select User_Car.CarID, User_Car.User_ID, User_Car.CarBrand
from User_Car where User_Car. User_ID =@userID)</code></pre>
<p>This leads to more round trips to the database. Instead, we can opt for Eager loading.</p>
<p><strong>Eager Loading:</strong></p>
<p>Defining associate Objects  which are require in advance.So when LINQ execute query then it fetch only that objects.And LINQ fire a single on database.</p>
<p>For Example,</p>
<pre><code>DataContext dc= new DataContext ();
DataLoadOptions options = new DataLoadOptions ();
option.Loadwidth&lt;User&gt; (U =&gt; U.User_Car)
dc.LoadOptions = options; </code></pre>
<p>(Here, User_Car object as pre-fetch object. So when we write query on User Object then automatically User_car records get fetch.)</p>
<p>e.g</p>
<pre><code>var userObj = from user in DataContext.User
               Select user;</code></pre>
<p>SQL Query is,</p>
<pre><code>(Select User.ID, User.Name, User_Car.CarID, User_Car.User_ID,
User_Car.CarBrand from User join User_Car on
User.ID=User_Car.User_ID)</code></pre>
<p>And when we write</p>
<pre><code>Int carId= userObj.User_Car.CarID</code></pre>
<p>It fetches the record from memory only. So Eager Loading reduce the Database round Trips and Improve the performance.</p>
<h3><strong>2. Use DataLoadOption.AssociateWith ()</strong></h3>
<p>In Eager Loading, When association of Master object and child object are based on non PrimaryKey then use <strong>DataLoadOption.AssociateWith (). </strong> It will optimize SQL query and give better Performance.</p>
<h3><strong>3.Set ObjectTrackingEnabled = False</strong></h3>
<p>LINQ objects are use only for data retrieval (No insert, update, delete operations are required) then make this flag off.It will avoid Identity Field(Auto-Increment Field) management process.</p>
<h3><strong>4. Set Delay Loaded = True</strong></h3>
<p>Field which is not in use or huge in size of contain for particular object then set this property as True.So we access the field then only data get  load.</p>
<h3><strong>5. Use Compiled Query</strong></h3>
<p>Compiled Query skip the steps of  generating Expression Tree and generating SQL Query  of Process Life Cycle.When First time query get executed, the expression tree and SQL query is generated and next time system will use same for execution.</p>
<p>e.g</p>
<pre><code>Public static Func&lt;DataContext, int, IQueryable&lt;User&gt;&gt;
    UserByID=
	    CompiledQuery.Compile ((DataContext db, int UserID) =&gt;
            From U in db.User where U.ID == UserID select U);</code></pre>
<p>When we call Function first time the expression tree and SQL query will be generate and next time system will use the same to execute query on database.</p>
<p>After applying one or more of the above tips, a LINQ application will definitely perform better and thus will ensure faster response times to business needs.</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/07/5-performance-enhancement-tips-for-linq-coupled-with-mssql-server/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/07/5-performance-enhancement-tips-for-linq-coupled-with-mssql-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>8 things about jQuery which makes it a powerful tool to write rich client side scripting</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/07/8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/07/8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 06:21:56 +0000</pubDate>
		<dc:creator>Kiran Dangar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=449</guid>
		<description><![CDATA[
			
				
			
		
For whom the client side scripting becomes a headache OR for those who loves client side scripting… jQuery is a great way of doing client side scripting with ease and fun. Playing with HTML DOM elements using jQuery is really a fun and as easy as writing ABCD  
Introduction: jQuery is actually an Open [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2F8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2F8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>For whom the client side scripting becomes a headache OR for those who loves client side scripting… jQuery is a great way of doing client side scripting with ease and fun. Playing with HTML DOM elements using jQuery is really a fun and as easy as writing ABCD <img src='http://www.gatewaytechnolabs.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Introduction: </strong>jQuery is actually an Open Source cross-browser JavaScript library which allows faster and easier JavaScript development then the traditional JavaScript development.</p>
<p>There are 8 things which gives power to the developers for building robust and excellent client side scripts.</p>
<p><strong>1 &#8211; Cross browser support</strong> :<br />
Those who have ever written traditional JavaScript, they must have faced problems with diff. browser support and it becomes a tedious stuff for detecting browser behaviors and writing separate logics for all , but jQuery has wiped out all those problem by giving cross browser support. So no more cross-browsing compatibility issues here.</p>
<p><strong>2 &#8211; jQuery selectors , manipulation &amp; Traversing</strong><br />
Every web developers must have used CSS and its syntax for defining styles by class (with DOT) / elements  / element ID (using #), jQuery also uses all common CSS syntax for selecting a set of DOM elements which is called jQuery Selectors.</p>
<p>i.e. $(“#sample”)  will return all the DOM elements with [ ID = sample ]<br />
$(“div.xyz span#abc”) will return only those &lt;span&gt; elements with ID= abc and are child of a &lt;div&gt; with class name “xyz”</p>
<p>To learn more you can visit :<a href="http://api.jquery.com/category/selectors/"> http://api.jquery.com/category/selectors/</a></p>
<p><strong>3 &#8211; jQuery EventBinding</strong><br />
jQuery supports all such events like click ,mouse over/move,load, etc. Writing event on any set of DOM elements are also becomes easier with JQ, by just passing a function as a parameter in event binding.<br />
its as easy as this : $(“#sample”).click(function(){ alert(‘Hi there !’); });<br />
To learn more you can visit :<a href="http://api.jquery.com/category/events/"> http://api.jquery.com/category/events/</a></p>
<p><strong>4 &#8211; Callback functions</strong><br />
jQuery also facilitates the callback functions in many methods which becomes useful while working with animations or any timer based functionalities.</p>
<p>i.e.  $(“#sample”).show(“slow”, [ optional callback function ] );</p>
<p><strong>5 &#8211; Utilization of JSON</strong><br />
JSON stands for “JavaScript object notation”. Use of JSON everywhere as an optional parameters makes jQuery more flexible and powerful for passing a set of parameters.<br />
Jquery utilizes JSON format widely in most of inbuilt functions ,all AJAX methods and in jQuery plug-in development as well.</p>
<p>i.e.  $(“#sample”).css({height:”40px”, color:”black” });</p>
<p><strong>6 &#8211; jQuery AJAX</strong><br />
jQuery gives a variety of AJAX functionalities to the developers with extensive use of callbacks for different AJAX events, and a good thing about jQuery AJAX is that we don’t have to take care about cross-browser compatibility issues. and no need to take care of xmlHTTP object n all.<br />
It gives different functions for all kind of developer’s needs</p>
<p>i.e. $(“#sample”).load( [ URL] ); – a very basic function, which will load the HTML from the specified URL into #sample.</p>
<p>To learn more visit : <a href="http://api.jquery.com/category/ajax/">http://api.jquery.com/category/ajax/</a></p>
<p><strong>7 &#8211; jQuery plugins</strong><br />
jQuery plug-in is a concept or we can say a mechanism of making our own functionality generalized by packaging it all together as a plug-in.<br />
jQuery plug-in offers great portability to the code and of course code re-usability with ease.</p>
<p>To learn more visit : <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Plug_me:_Writing_your_own_plugins">http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Plug_me:_Writing_your_own_plugins</a></p>
<p><strong>8 &#8211; JQuery UI</strong><br />
jQuery UI is an Open Source library which is built on core jQuery.<br />
It can be used to built highly interactive web applications,<br />
jQuery UI offers a wide range of inbuilt functions for animations, effects , themes mechanism , rich  UI widgets and complex behaviors like Drag-Drop , resizing , selection &amp; sorting.</p>
<ul>
<li>jQuery UI categorizes all functionalities in main 3 section given below
<ul>
<li><strong>Interaction:</strong> Covers complex behaviors like Drag-Drop elements, Resizing and Sorting. And provides a wide range of options for handling different behaviors and scenarios</li>
<li><strong>Widgets: </strong>Fully functional rich UI elements (ultimately jQuery plug-ins) with a Rich User Interface and flexible theming options.</li>
<li><strong>Effects: </strong>Enables supports of various animation and transition effects like slide,blind,bounce, drop,fade etc.</li>
</ul>
</li>
</ul>
<p>To learn more visit : <a href="http://jqueryui.com/demos/">http://jqueryui.com/demos/</a></p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/07/8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/07/8-things-about-jquery-which-makes-it-a-powerful-tool-to-write-rich-client-side-scripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Template Method Pattern</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/07/the-template-method-pattern/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/07/the-template-method-pattern/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 07:02:28 +0000</pubDate>
		<dc:creator>sgadhavi</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Pattern & Practices]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=420</guid>
		<description><![CDATA[
			
				
			
		
The Template Pattern uses the inheritance beautifully to take advantage of code reuse. No composition is used because of the strict nature of the circumstances where this pattern should be used. The subclasses are bound to implement the abstract behavior of superclass and give the implementation in their own way and yet the sequence of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2Fthe-template-method-pattern%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2Fthe-template-method-pattern%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong></strong>The Template Pattern uses the inheritance beautifully to take advantage of code reuse. No composition is used because of the strict nature of the circumstances where this pattern should be used. The subclasses are bound to implement the abstract behavior of superclass and give the implementation in their own way and yet the sequence of algorithm is made unchangeable by making the method, of superclass which has the algorithm, final.</p>
<p><strong>Definition</strong>: Defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm&#8217;s structure.</p>
<p><strong>When to use it</strong>: When you have a fixed algorithm to execute from a superclass and which must not be changed in sequence but should behave differently in subclass specific way then its good to use this pattern for</p>
<ol>
<li>Integrity reason of the algorithm&#8217;s sequence.</li>
<li> Code reuse, if there are many subclasses which all depend on superclass implementation of certain functions which are of similar nature.</li>
</ol>
<p><strong>How to use it</strong>: Superclass will have certain methods, whose implementation is given by superclass itself and some methods which are defined as abstract, and thus, must be implemented by the subclasses. In this pattern, a superclass will define a method, which has a fixed sequence in calling some methods, we call it template method or an algorithm. Define this template method as final in superclass so that, subclasses can not change the sequence of algorithm and still contribute subclass-specific way by giving their own implementation of abstract methods. So the client will call the final method of subclass, inherited from superclass, and get the implementation of the algorithm in the subclass-specific way.</p>
<p><strong>Example</strong>: The diagram 1.1 shows the initial design, where two different classes has an algorithm which has same sequence of methods but each having its implementation of those methods in their own way. Here, the same code is scattered across the classes.</p>
<p><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/07/Template-Pattern.jpg"><img class="alignnone size-medium wp-image-421" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/07/Template-Pattern-300x173.jpg" alt="Diagram 1.1" width="300" height="173" /></a></p>
<p>The diagram 1.2 shows the Template Method Pattern, where we take out the common behavior of subclasses into superclass creating a common point of change which will reflect to all the subclasses. We define the subclass-specific methods in superclass as abstract thus making mandatory for subclass to give implementation. Also, we create a new method, Template Method(on which the name is given to this pattern), by calling the methods in the sequence by which we want our common algorithm to be executed. And , defining it as final so that we are sure that no subclass can change the sequence and just give its own implementation.</p>
<p><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/07/Diagram-1.jpg"><img class="alignnone size-medium wp-image-423" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/07/Diagram-1-300x211.jpg" alt="Diagram 1.2" width="300" height="211" /></a></p>
<p><strong>Conclusion</strong>: To conclude, the sequence,which must be same throughout the subclasses, is defined by the superclass and some part of the algorithm is executed by subclasses .Such design is a very good example of secure algorithm ensuring fixed sequence but with added touch of subclasses who give their own implementation.</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/07/the-template-method-pattern/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/07/the-template-method-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Look at Model-View-Presenter (MVP) Architecture</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/07/a-quick-look-at-model-view-presenter-mvp-architecture/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/07/a-quick-look-at-model-view-presenter-mvp-architecture/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 14:01:03 +0000</pubDate>
		<dc:creator>Amit Patel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVP]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=397</guid>
		<description><![CDATA[
			
				
			
		
As UI-creation technologies such as ASP.NET and Windows® Forms become more and more powerful, it&#8217;s common practice to let the UI layer do more than it should. Without a clear separation of responsibilities, the UI layer can often become a catch-all for logic that really belongs in other layers of the application. One design pattern, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2Fa-quick-look-at-model-view-presenter-mvp-architecture%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F07%2Fa-quick-look-at-model-view-presenter-mvp-architecture%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As UI-creation technologies such as ASP.NET and Windows® Forms become more and more powerful, it&#8217;s common practice to let the UI layer do more than it should. Without a clear separation of responsibilities, the UI layer can often become a catch-all for logic that really belongs in other layers of the application. One design pattern, the Model View Presenter (MVP) pattern, is especially well suited to remove lost of logic from UI layer.</p>
<h3>Some noteworthy benefits of MVP pattern:</h3>
<ul>
<li><strong>Platform independent:</strong> In this Pattern application make independent from its platform so when ever requirement comes to move to window to web or any other version its    only need to change on code behind page for view Implementation, so later on required to any of the application portion convert in web to window or any other platform we can handle it by minimum efforts.</li>
<li><strong>Loose couples form UI:</strong> So application stays loose couples from code behind page (UI) to business layer or any other next latter.</li>
<li><strong>Useful to create automated unit test:</strong> MVP is purely loose couples from any plate form so that it is very use to prepare automated unit test cases.</li>
<li><strong>Increase code maintainability:</strong> Keeps code more maintainable throughout the lifetime of the project, especially during the maintenance phase.</li>
</ul>
<h3>Overall Application Architecture:</h3>
<p><strong><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/MVP4.jpg"></a></strong><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/MVP4.jpg"><img class="aligncenter size-medium wp-image-427" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/MVP4-228x300.jpg" alt="mvp-diagram" width="228" height="300" /></a></p>
<ol>
<li><strong>Model:</strong> Model is UI interface for how and what the data are needed to displayed.</li>
<li><strong>View:</strong> Show the representation of model, that can be build in presenter</li>
<li><strong>Presenter:</strong> Build all data for model and pass all data to model in form of view by communicating with services class( or business logic layer)</li>
</ol>
<p style="margin-bottom: 0pt;">Below is the MVP patterns example with service class:</p>
<p style="margin-bottom: 0pt;"><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/MVP-Class3.jpg"><img class="aligncenter size-full wp-image-406" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/MVP-Class3.jpg" alt="" width="185" height="109" /></a></p>
<p style="text-indent: -0.25in; margin: 5pt 0in 0pt 0.5in;">
<p style="margin-bottom: 0pt;"><strong>1. User Interface Layer</strong></p>
<p style="text-indent: 0.5in; margin-bottom: 0pt;">In this section contains actual UI, in .net terms its aspx or ascx pages.</p>
<p><strong>2. Presentation Layer ( MVP :- Code behind + view (interfaces) + Presenter)</strong></p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 1.5pt;">In this layer we have designed as MVP patters so it’s divided in below three parts.</p>
<p style="text-indent: -0.25in; margin: 5pt 0in 0pt 73.5pt;">a.    <strong>View – It is interfaces.</strong> This interface contains signature of all properties and events that needs to implement in code behind page that will be use in presenter class.</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">I.e.</p>
<p><code> </code></p>
<p><code> </code></p>
<p style="margin: 5pt 0in 0pt 1in;">Public Interface Icustomer</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 1in;">ReadOnly Property CustomerName()</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 1in;">WriteOnly Property DisplayMessage()</p>
<p style="margin: 5pt 0in 0pt 1in;">End Interface</p>
<p style="text-indent: -0.25in; margin: 5pt 0in 0pt 73.5pt;">b.      <strong>Code Behind (Model)</strong> &#8211; In this class we need to implement View.(No need to specify any logic). We are just implement properties which is defined in view.</p>
<p><code> </code></p>
<p><code> </code></p>
<p style="text-indent: 1.5pt; margin: 5pt 0in 0pt 1in;">#Region &#8220;Member&#8221;</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 69.85pt;">Dim Presenter As CustomerPresenter</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 33.85pt;">#End Region</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Presnter = New CustomerPresenter(Me)</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Presnter.LoadData()</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">End Sub</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">ReadOnly Property CustomerName() Implements ICustomer.CustomerName</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Get</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Return textCustomerName.Text</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">End Get</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">End Property</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">WriteOnly Property DisplayMessage() Implements ICustomer.DisplayMessage</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Set(ByVal value)</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">Response.Write(value)</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">End Set</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">End Property</p>
<p style="margin: 5pt 0in 0pt 105.85pt;">
<p style="text-indent: -0.25in; margin: 5pt 0in 0pt 73.5pt;"><code> </code><br />
c.    <strong>Presenter -</strong> In this class we are using all those members which we have specified in view and implemented in code behind. Presenter class is responsible for execute methods of business layer.</p>
<p style="text-indent: 2.95pt; margin: 5pt 0in 0pt 70.55pt;"><code>Public Class CustomerPresenter</code></p>
<p><code> </code></p>
<p><code> </code></p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Private iView As ICustomer</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Private SessionProvider As ISessionProvider</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Public Sub New(ByVal view As ICustomer)</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Me.iView = view</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">End Sub</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">&#8216;Public Sub New(ByVal view As ICustomer, ByVal SessionProvider As ISessionProvider)</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">&#8216; Me.iView = view</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">&#8216; Me.SessionProvider = SessionProvider</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">&#8216;End Sub</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Public Sub LoadData()</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">Me.iView.DisplayMessage = Me.iView.CustomerName</p>
<p style="margin: 5pt 0in 0pt 106.55pt;">End Sub</p>
<p style="text-indent: 0.5in; margin: 5pt 0in 0pt 0.5in;">End Class</p>
<h3><span style="font-size: 15px;">Summary:</span></h3>
<ul>
<li>MVP is little prolonged process to implement and understanding in the beginning, but later on it will be very useful as it provides application maintainability on application maintenance phase, increase code re-usability. A good thing about it is a clear distinction of different layers.  For example, all the code is separate from the user interface.</li>
<li>MVP is a strong consideration candidate for large scale projects especially where project maintainability re-usability are the key success criteria. It suits well with automated test cases methods also.</li>
</ul>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/07/a-quick-look-at-model-view-presenter-mvp-architecture/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/07/a-quick-look-at-model-view-presenter-mvp-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart and Effective Use of SQL Server&#8217;s Pool of Shared Memory</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/06/smart-and-effective-use-of-sql-servers-pool-of-shared-memory/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/06/smart-and-effective-use-of-sql-servers-pool-of-shared-memory/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 07:47:39 +0000</pubDate>
		<dc:creator>Sarbjeet Singh</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=273</guid>
		<description><![CDATA[
			
				
			
		
Microsoft SQL Server has an effective pool of shared memory which ideally is used for two purposes .

Data buffer;
Execution plan cache.

It is commonly known that a query executed second time always gives response faster than the first time. In this post I&#8217;m going to discuss what works behind this and how can we make sure [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fsmart-and-effective-use-of-sql-servers-pool-of-shared-memory%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fsmart-and-effective-use-of-sql-servers-pool-of-shared-memory%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Microsoft SQL Server has an effective pool of shared memory which ideally is used for two purposes .</p>
<ol>
<li>Data buffer;</li>
<li>Execution plan cache.</li>
</ol>
<p>It is commonly known that a query executed second time always gives response faster than the first time. In this post I&#8217;m going to discuss what works behind this and how can we make sure that the shared memory is effectively used.</p>
<p><strong>What works behind this?</strong><br />
The shared memory part which is commonly known as execution plan cache (also known as procedure cache) save the execution plans of all the queries executed in SQL Server. When a query is executed this area of memory is looked into to determine if any of the existing execution plan can be re-used for this query. If the plan is not found then the query is parsed, compiled, optimized for execution and then the execution plan of the same is stored in the execution plan cache. <em>That is the reason of queries working faster in subsequent time than the first time.</em></p>
<p><strong>How to make effective use of execution plans</strong><br />
For each query executed in SQL Server an execution plan is saved but its not necessary that the execution plan stored is useful enough that its used for other queries also. To better understand this lets have an look how SQL Server saves the execution plan.</p>
<p>SELECT UseCounts, CacheObjType, ObjType, ST.Text FROM sys.dm_exec_cached_plans<br />
cross apply sys.dm_exec_sql_text(plan_handle) as ST<br />
ORDER BY ST.text</p>
<p><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/adhoc.jpg"><img class="alignnone size-full wp-image-382" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/adhoc.jpg" alt="" width="546" height="160" /></a><br />
﻿﻿<br />
In the above screenshot let&#8217;s concentrate on the area which is in red. These three execution plans are the result of non-parameterized ad-hoc queries executed from the code of application inside an iteration. In this case none of the execution plans are effective, for each query a new execution plan is required. The query in the code was written something like below.</p>
<p>string sql = &#8220;SELECT * FROM URls where urlid=&#8221; + a;<br />
where &#8220;a&#8221; is the varying value of the iteration</p>
<p>Had this query been a parametrized query only one execution plan would have been created and used for all the iteration. Let&#8217;s take an example to understand this better. Now my query would be something like.</p>
<p>string sql = &#8220;SELECT * FROM URls where urlid=@a&#8221;;<br />
SqlCommand cmd = new SqlCommand(sql, myConn);<br />
cmd.Parameters.Add(new SqlParameter(&#8220;@a&#8221;, a));</p>
<p>Now let&#8217;s have a look at the execution plans</p>
<p><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/prepared.jpg"><img class="alignnone size-full wp-image-381" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/prepared.jpg" alt="" width="715" height="100" /></a></p>
<p>In the above screenshot you would realize that only one execution plan has been created and its &#8220;usecounts&#8221; is 3, that means this plan has been used three time. Reusable execution plans means lesser CPU utilization , lesser utilization of memory for execution plan cache there by leaving more memory available for data buffer.</p>
<p><strong>Conclusion</strong><br />
Though SQL Server maintains the execution plan of each query but making effective use of it is some what in our hands. There should be no piece of code in the application which is making use of ad-hoc queries it should always be parameterized queries. Though I personally prefer to use stored procedure since allowing direct access to the tables can be a security risk.</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/06/smart-and-effective-use-of-sql-servers-pool-of-shared-memory/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/06/smart-and-effective-use-of-sql-servers-pool-of-shared-memory/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Entity Framework &#8211; Microsoft&#8217;s Step Towards ORM Building</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/06/entity-framework-microsofts-step-towards-orm-building/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/06/entity-framework-microsofts-step-towards-orm-building/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 05:53:56 +0000</pubDate>
		<dc:creator>punitraval</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Data access layer]]></category>
		<category><![CDATA[EDM]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=331</guid>
		<description><![CDATA[
			
				
			
		
Whenever we develop a new application, lots of things play key role to decide application architecture. Among these, database interaction is the major. In earlier days of .NET 2.0, no significant tools were available from Microsoft to create data access layer for database interaction. People had to use third party utilities for conceptual data modeling [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fentity-framework-microsofts-step-towards-orm-building%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fentity-framework-microsofts-step-towards-orm-building%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Whenever we develop a new application, lots of things play key role to decide application architecture. Among these, database interaction is the major. In earlier days of .NET 2.0, no significant tools were available from Microsoft to create data access layer for database interaction. People had to use third party utilities for conceptual data modeling over the physical database.</p>
<p>Realizing this need Microsoft introduced<strong> LINQ to SQL for conceptual data modeling,</strong> though it comes with limited set of functionalities and can be used by SQL Server database only. To overcome this situation, Microsoft has taken steps to release new feature called <strong>Entity Framework</strong> with ADO.NET 3.5 SP1 release.</p>
<p><strong>ADO.NET Entity Framework is an Object – Relational Mapping (ORM) framework.</strong> It builds on the concept of <strong>Entity Relationship Model</strong> by introducing a conceptual model, called the <strong>Entity Data Model (EDM)</strong> which sits between your code and the underlying schema (database). This abstraction helps a lot to reduce the efforts as well the complexity for moving relational data to object oriented programming.</p>
<h3><strong>Entity Framework architecture:</strong></h3>
<p>Here is how the Entity Framework is layered to abstract the relational schema of a database and present a conceptual model.</p>
<table>
<tbody>
<tr>
<td rowspan="7"><a href="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/EFArchitecure22.png"><img class="alignnone size-full wp-image-344" src="http://www.gatewaytechnolabs.com/blog/wp-content/uploads/2010/06/EFArchitecure22.png" alt="Entity Framework Architecture" width="241" height="379" /></a></td>
<td>
<ul>
<li>Data Source: It represents one or many databases.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>ADO.NET Data Providers: It will access data from data source.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>Entity Data Model (EDM): EDM contains entity classes, storage container and mapping of the entity with the table.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>Entity Client: It is an ADO.NET managed provider that supports accessing data described in an EDM.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>Object Services: This component enables you to query, insert, update, and delete data, expressed as strongly typed CLR objects that are instances of entity types.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>Entity SQL (ESQL): It is a derivative of Transact-SQL, designed to query and manipulate entities. Both Object Services and Entity Client components can execute Entity SQL statements.</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>LINQ to Entities: It is used to query against entities defined in the EDM.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3><strong>Advantages:</strong></h3>
<ul>
<li>You can use the Entity Framework against <strong>not only SQL Server but also Oracle, DB2, Informix, MySQL, Postgres</strong> etc with the help of its data providers.</li>
<li>You can create data access layer with the ease of Entity Framework wizards. Developer can work with data rather than coding against rows and columns.</li>
<li>It is truly a foundation stone for Microsoft’s data access platform. one of the use of this platform  is <strong>REST based ADO.NET data service aka Astoria</strong>.</li>
</ul>
<h3><strong>How to build:<span id="more-331"></span><br />
</strong><strong> </strong></h3>
<p><strong>Visual Studio 2008</strong> and onward have <strong>ADO.NET Entity Data Model (.edmx) template</strong> which can be used to generate entity relationship. Using the template, wizards helps you to generate the entity model relationship.</p>
<h3><strong>Conclusion:</strong><strong> </strong></h3>
<p>ADO.NET Entity Framework is interesting technology for data accessing requirements. Microsoft has put a welcome step to reduce the developer headache.</p>
<p>This means that developers can focus more on solving business problems and contribute towards organization&#8217;s <a href="http://www.gatewaytechnolabs.com/lang,en/contract@gateway/why_outsource_to_gateway?.html" target="_blank">goals to help the customers</a> by supporting their business effectively.</p>
<p>Stay tuned to explore more about Entity Framework in the following posts.</p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/06/entity-framework-microsofts-step-towards-orm-building/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/06/entity-framework-microsofts-step-towards-orm-building/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cloud Computing – IaaS, PaaS, SaaS – The Game Changers!</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/06/cloud-computing-%e2%80%93-iaas-paas-saas-%e2%80%93-the-game-changers/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/06/cloud-computing-%e2%80%93-iaas-paas-saas-%e2%80%93-the-game-changers/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 04:58:34 +0000</pubDate>
		<dc:creator>Pranav Gupta</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Clound and SAAS]]></category>
		<category><![CDATA[Windows Azure Tools]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=299</guid>
		<description><![CDATA[
			
				
			
		
Cloud computing means Internet based computing mechanism where Software, Hardware and other resources which are available in shared mode and can be utilized as and when required.  These are virtual resources which offer dynamic scalability over the web – this is the essence of the Cloud computing.
There are many cloud services that can be envisioned, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fcloud-computing-%25e2%2580%2593-iaas-paas-saas-%25e2%2580%2593-the-game-changers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fcloud-computing-%25e2%2580%2593-iaas-paas-saas-%25e2%2580%2593-the-game-changers%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Cloud computing means Internet based computing mechanism where Software, Hardware and other resources which are available in shared mode and can be utilized as and when required.  These are virtual resources which offer dynamic scalability over the web – this is the essence of the Cloud computing.</p>
<p>There are many cloud services that can be envisioned, but the main ones are IaaS  (Infrastructure-as-a-Service), PaaS (Platform-as-a-Service), and SaaS  (Software-as-a-Service).</p>
<p><strong>Consider this scenario:</strong></p>
<p>You have an E-Commerce application which sales grocery products. You have deployed it on a dedicated server which has high CPU speed, high memory and necessary disk space. You noticed that you have major traffic on your website every evening at around 6 to 8 PM and on weekends. During this period you receive 70% of your orders. Still there are many customers who would not order on your website due to over-traffic and connectivity issues. Either you need to add a new server or need to leave that chunk of business.</p>
<p>Here, Cloud Computing gives you the flexibility where in you can select extra resources for your peak business hours (which are 6 to 8 PM and the weekends in this case), there by avoiding the need of extra full-time servers for managing extra traffic. This way you will be able to save dollars on your hardware and infrastructure cost and keep your clients happy by giving them needed speed and better user experience.</p>
<p>Cloud computing offers great value in such situations.</p>
<p><strong>Cloud at its best:</strong></p>
<p>We are close to that virtual world where-in we will have very light-weight PCs and all the useful local machine data will be stored in some kind of a cloud, thereby giving access to the data 24&#215;7, 365 days from any location. Web is going to be significantly different and more effective.</p>
<p><strong>Cloud and SaaS:</strong></p>
<p>If you are using a <a href="http://en.wikipedia.org/wiki/Software_as_a_service" target="_blank">SaaS model</a> application, you don&#8217;t need to buy that application. Instead, you only need to pay a subscription fee. You need not to worry about the maintenance of that application or server where it is hosted. All you need to do is to pay your subscription fee and start using that application. SaaS application providers host it on a set of servers and sell its subscriptions to the various customers. Tomorrow, if you come and ask the SaaS provider that you need to have an account for your additional few hundreds of employees for the same SaaS application you’re using, they will change it from SaaS model to the Cloud Computing. This is <a href="http://www.google.com/howgoogleworks" target="_blank">how Google works</a>.<br />
<strong><img class="alignright" style="margin: 4px;" src="http://farm3.static.flickr.com/2610/4205167808_dbdc69155b.jpg" alt="" width="192" height="288" /></strong></p>
<p><strong>Cloud development tools:</strong></p>
<p>Microsoft Visual Studio 2010 has cloud development tools which allows the developers to write their cloud centric web applications and services. Developing scalable web applications and services have become easier now and can be tested on Windows Azure simulation environment.</p>
<p>Microsoft SQL Azure is a cloud based relational database service built on SQL Server technology. It provides highly scalable database service.</p>
<p>Interesting thing is that, any existing ASP.Net application can be converted to cloud application in few steps, with the help of above tools. <a href="http://blogs.msdn.com/b/jnak/archive/2010/02/08/migrating-an-existing-asp-net-app-to-run-on-windows-azure.aspx" target="_blank">See here</a></p>
<p><strong>Summary:</strong></p>
<p>Cloud computing is a fantastic approach to manage your business applications. It&#8217;s really helpful to small, medium and big sized organizations to manage their data and infrastructure securely, easily and in cost effective fashion.  HP, IBM, VMware, Amazon, Google and Microsoft are extensively using cloud computing. In fact they are <a href="http://www.windowsitpro.com/article/cloud-computing2/The-Rise-of-Cloud-Computing/2.aspx" target="_blank">cloud service providers</a> as well.</p>
<p><small> Photo Credit: <a id="contextLink_stream34666709@N00" href="http://www.flickr.com/photos/betsyweber/"><em>betsyweber&#8217;s Flickr photostream</em></a><em><small></small></em></small></p>
<p><small><em><small></small></em></small></p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/06/cloud-computing-%e2%80%93-iaas-paas-saas-%e2%80%93-the-game-changers/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/06/cloud-computing-%e2%80%93-iaas-paas-saas-%e2%80%93-the-game-changers/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>I am proud to be an “Environment Friendly” person! Are you?</title>
		<link>http://www.gatewaytechnolabs.com/blog/2010/06/i-am-proud-to-be-an-%e2%80%9cenvironment-friendly%e2%80%9d-person-are-you/</link>
		<comments>http://www.gatewaytechnolabs.com/blog/2010/06/i-am-proud-to-be-an-%e2%80%9cenvironment-friendly%e2%80%9d-person-are-you/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 03:30:59 +0000</pubDate>
		<dc:creator>Sandeep Kulkarni</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.gatewaytechnolabs.com/blog/?p=285</guid>
		<description><![CDATA[
			
				
			
		
“Go GREEN” is Buzzword around the globe.
World celebrated “Environment Day” recently on June 5, 2010.
Always growing energy demand, requirements of higher productivity, greater and greater urbanization, mobility, smarter communication media and Environment Protection are few important challenges of our times.
While we are reading and brushing through ways for the environment protection, let’s see how each [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fi-am-proud-to-be-an-%25e2%2580%259cenvironment-friendly%25e2%2580%259d-person-are-you%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.gatewaytechnolabs.com%2Fblog%2F2010%2F06%2Fi-am-proud-to-be-an-%25e2%2580%259cenvironment-friendly%25e2%2580%259d-person-are-you%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong><span style="color: #008000;">“Go GREEN”</span></strong> is Buzzword around the globe.</p>
<p>World celebrated “Environment Day” recently on June 5, 2010.</p>
<p>Always growing energy demand, requirements of higher productivity, greater and greater urbanization, mobility, smarter communication media and Environment Protection are few important challenges of our times.</p>
<p>While we are reading and brushing through ways for the environment protection, let’s see how each one of us can make a small contribution for the cause and be a part of big effect which will be for the benefits of everybody on mother earth.</p>
<p>Adopting a GREEN lifestyle at home is a best “first step” toward living healthier and helping to save the planet, but you can extend your influence even more by going green at work too.</p>
<p><strong><span style="color: #008000;">Consider these ways to reduce fatal impact on the environment:</span></strong></p>
<ul>
<li>Think twice before lowering the temperature in summers and increasing it in winter while programming the Air Conditioners. Each degree warmer you leave the thermostat in summer, and each degree cooler you set it in the winter can save 6 to 8 % in energy costs.</li>
<li>Be a guardian of one potted plant in the home / office. Artificial greenery might be low-maintenance, but the real plants add liveliness and oxygen to your surroundings.</li>
<li>Can we adopt a policy of “bring-your-own coffee mug” for the coffee breaks and avoid using the plastic cups. Your company will reduce plastic waste.</li>
<li>Keep pushing for online meetings instead of personal meetings whenever possible, as virtual meetings can save lot of time, money and fuel.</li>
<li>Reduce the use of energy for using computers by putting them on “Power Saving Mode”</li>
<li>Save Paper and Ink. Avoid printing documents that could be emailed, and as far as possible print necessary papers on both sides. Producing a single sheet of virgin paper requires an average of 20 watt-hours</li>
<li>Using one side printed “Not-So-Important” papers for internal note pads. Switch to recycled paper and water-based inks.</li>
<li>Consider using LCD monitors or laptops in place of CRT monitors, which can use up to 70 % less electricity and generate less heat waste.</li>
<li>Use Energy Star certified equipment for energy saving.</li>
<li>Turn off all electrical equipment when not in use.</li>
<li>Do not leave water taps dripping; make sure to close them tightly after use. One drop of water wasted every second amounts to 10,000 litres per year.</li>
<li>Educate your colleague about the use of environment friendly work ideas if he/she is not following them.</li>
<li>Use CFL bulbs, they consume 1/3 energy and last 10 times longer</li>
<li>If you have option of multiple elevators, do not call all elevators at a time. See which one is nearer and call for use.</li>
<li>Use Bicycles for shorter distance tavel</li>
<li>Use cotton bags in place of plastic / paper bags</li>
<li>I know it may sound pretty cliché, but if each of us would do just a couple of small things to reduce our impact, we could probably do a lot to help stave off the global environmental crisis</li>
</ul>
<p><span style="color: #008000;">Anyone can go green; there are many reasons beyond protecting environment such as</span></p>
<ol>
<li>Reverse Climate Change, reduce Global Warming and the hole in the Ozone Layer</li>
<li>To ensure the bright future of next generations</li>
<li>To preserve the limited amount of natural resources</li>
<li>To reduce pollution which harms us by contaminating Air, Water and Soil</li>
</ol>
<p>If you like and follow these, you&#8217;re an” environmentally conscious” person. You reduce, reuse, and recycle in your home and office, and you&#8217;ve taught your children / Colleagues / Friends to do these things, too.</p>
<p><strong><span style="color: #008000;">Go GREEN, Feel Proud.</span></strong></p>
<div id="pfButton"><a href="http://www.gatewaytechnolabs.com/blog/2010/06/i-am-proud-to-be-an-%e2%80%9cenvironment-friendly%e2%80%9d-person-are-you/?pfstyle=wp" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.gatewaytechnolabs.com/blog/2010/06/i-am-proud-to-be-an-%e2%80%9cenvironment-friendly%e2%80%9d-person-are-you/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

