<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tanzim Saqib on .NET discovery &#187; .NET</title>
	<atom:link href="http://tanzimsaqib.wordpress.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://tanzimsaqib.wordpress.com</link>
	<description>Innovate. Create. Share.</description>
	<lastBuildDate>Wed, 19 Nov 2008 10:04:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='tanzimsaqib.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/756ba5f132c23525771f86885e65d27c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Tanzim Saqib on .NET discovery &#187; .NET</title>
		<link>http://tanzimsaqib.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tanzimsaqib.wordpress.com/osd.xml" title="Tanzim Saqib on .NET discovery" />
		<item>
		<title>CallQueue: Implementing a Sequential Web Service Call Queue for AJAX application</title>
		<link>http://tanzimsaqib.wordpress.com/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax-application/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax-application/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 10:04:28 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax-application/</guid>
		<description><![CDATA[In AJAX based applications its common that user might end up breaking your AJAX calls by clicking on numerous places in very short interval of time. Let us assume there is a page where there are several of hyperlinks which make WebService calls and do some stuffs on callback. If user clicks on five hyperlinks [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=101&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In AJAX based applications its common that user might end up breaking your AJAX calls by clicking on numerous places in very short interval of time. Let us assume there is a page where there are several of hyperlinks which make WebService calls and do some stuffs on callback. If user clicks on five hyperlinks being impatient or may be just for fun, there will be five different WebService calls made. All of those calls had the same parameters or UI state while they were invoked. But on completion of one or more WebService calls it may happen that the UI state or data passed to the rest of the WebServices calls no longer exist or expired, thus will be result in inconsistent UI behaviour and/or invalid data. This is one of the important scenarios an AJAX developer should consider when he designs an application. </p>
<p><strong>The Specification<br /></strong>To address the scenario, I would prefer implementing a Sequential WebService Calls Queue which will be able to schedule the tasks/WebService calls and help keeping UI and data consistent over the AJAX calls. We should achieve the following features from this queue:</p>
<ul>
<li>Enqueue any WebService call anytime in the application.
<li>Dequeue any previously queued call regardless of currently executing call and location in the application.
<li>Each WebService call should have an identifier so that we can track the call and dequeue anytime later by SSQ.dq(call_id).
<li>Each call should have a timeout value which will determine the maximum amount of time we will consider for that particular call before we invoke the next call, after that we will remove from the queue.
<li>A timer will act as scheduler but will not run forever. It should run only when necessary.
<li>Each call should be able to declare its completion at any time by notifyCompleted, so that the scheduler timer will not wait for the prior task and should dequeue the next call.
<li>notifyCompleted should also be optional. The currently running call should automatically be dequeued from the scheduler queue after the timeout of its own.
<li>Each call should be able to mark as replaceIfExists so that if user`s any activity already enqueued this call, should be replaced by the current one.
<li>The queue instance should be exclusively available to the user and all over the page, meaning that the same queue class will be used to serve the functionality in one page per user basis.</li>
</ul>
<p><strong>The Usage<br /></strong>You should be able to use this library as follows:</p>
<ol>
<li>Include GenericQueue.js and SequentialServiceQueue.js to your project
<li>Add the reference in the pages that you want them to be used</li>
</ol>
<p>We will be naming the class as SequentialServiceQueue and in short SSQ. Let us have a look at the WebService calls in Service Queue fashion:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:fc2046a6-27d0-4752-a768-75c189e3c3e0" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#0000FF;">var</span><span style="color:#000000;"> id1 </span><span style="color:#000000;">=</span><span style="color:#000000;"> SSQ.nq(</span><span style="color:#000000;">'</span><span style="color:#000000;">SomeMethod1</span><span style="color:#000000;">'</span><span style="color:#000000;">, </span><span style="color:#0000FF;">false</span><span style="color:#000000;">, </span><span style="color:#000000;">1000</span><span style="color:#000000;">,
    </span><span style="color:#0000FF;">function</span><span style="color:#000000;">()
    {
        </span><span style="color:#008000;">//</span><span style="color:#008000;"> Do some stuffs</span><span style="color:#008000;">
</span><span style="color:#000000;">        SomeWebService1.SomeMethod1(SomeParameters, onSomeMethodCallCompleted);
    });

</span><span style="color:#0000FF;">function</span><span style="color:#000000;"> onSomeMethodCallCompleted(result)
{
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Do stuffs</span><span style="color:#008000;">
</span><span style="color:#000000;">    SSQ.notifyCompleted(id1);
}

</span><span style="color:#0000FF;">var</span><span style="color:#000000;"> id2 </span><span style="color:#000000;">=</span><span style="color:#000000;"> SSQ.nq(</span><span style="color:#000000;">'</span><span style="color:#000000;">SomeMethod2</span><span style="color:#000000;">'</span><span style="color:#000000;">, </span><span style="color:#0000FF;">false</span><span style="color:#000000;">, </span><span style="color:#000000;">1000</span><span style="color:#000000;">,
    </span><span style="color:#0000FF;">function</span><span style="color:#000000;">()
    {
        </span><span style="color:#008000;">//</span><span style="color:#008000;"> Do some stuffs</span><span style="color:#008000;">
</span><span style="color:#000000;">        SomeWebService2.SomeMethod2(SomeParameters,
            </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(result)
            {
                </span><span style="color:#008000;">//</span><span style="color:#008000;"> Do stuffs</span><span style="color:#008000;">
</span><span style="color:#000000;">                SSQ.notifyCompleted(id2);
            });
    });</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>You can not only queue WebService calls, but also regular JavaScript codeblock:</p>
<div style="width:619px;display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:27c0c167-37c3-4e49-a541-ba0fa9b18eb8" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#0000FF;">var</span><span style="color:#000000;"> service_id1 </span><span style="color:#000000;">=</span><span style="color:#000000;"> SSQ.nq(</span><span style="color:#000000;">'</span><span style="color:#000000;">Service1</span><span style="color:#000000;">'</span><span style="color:#000000;">, </span><span style="color:#0000FF;">false</span><span style="color:#000000;">, </span><span style="color:#000000;">1000</span><span style="color:#000000;">,
    </span><span style="color:#0000FF;">function</span><span style="color:#000000;">()
    {
        </span><span style="color:#008000;">//</span><span style="color:#008000;"> Do some stuffs</span><span style="color:#008000;">
</span><span style="color:#000000;">        SSQ.notifyCompleted(service_id1);
    });</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p><strong>The GenericQueue<br /></strong>To accomplish the SequentialServiceQueue, first of all we should define an all purpose GenericQueue class which will able to handle any queue requirement out of the box. The queue is fairly simple, just like old Computer Science data structure class. Here are few of the functions from the class:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:3376f21b-d36c-474a-9973-b2befdf1374e" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#0000FF;">this</span><span style="color:#000000;">.nq </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(element)
{
    array.push(element);
    </span><span style="color:#000000;">++</span><span style="color:#000000;">rear;
}

</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.dq </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">function</span><span style="color:#000000;">()
{
    </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> element </span><span style="color:#000000;">=</span><span style="color:#000000;"> undefined;

    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#000000;">!</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.is_empty())
    {
        element </span><span style="color:#000000;">=</span><span style="color:#000000;"> array.shift();
        </span><span style="color:#000000;">--</span><span style="color:#000000;">rear;
    }

    </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> element;
}

</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.for_each </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(func)
{
    </span><span style="color:#0000FF;">for</span><span style="color:#000000;"> (</span><span style="color:#0000FF;">var</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;">; i </span><span style="color:#000000;">&lt;</span><span style="color:#000000;"> rear; </span><span style="color:#000000;">++</span><span style="color:#000000;">i)
        func(i, array[i]);
}

</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.delete_at </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(index)
{
    </span><span style="color:#0000FF;">delete</span><span style="color:#000000;"> array[index];

    </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> index;
    </span><span style="color:#0000FF;">while</span><span style="color:#000000;"> (i </span><span style="color:#000000;">&lt;</span><span style="color:#000000;"> array.length)
        array[i] </span><span style="color:#000000;">=</span><span style="color:#000000;"> array[</span><span style="color:#000000;">++</span><span style="color:#000000;">i];

    array </span><span style="color:#000000;">=</span><span style="color:#000000;"> array.slice(</span><span style="color:#000000;">0</span><span style="color:#000000;">, </span><span style="color:#000000;">--</span><span style="color:#000000;">rear);
}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p><strong>The SequentialServiceQueue</strong><br />The following is how this class starts. You will notice here that the timer_id is for our scheduler timer, running_task indicates the currently executing call, interval is a variable for the timer_id which you can determine as your wish. interval is the knob of how fast or slow you want the scheduler to run. queue as you can understand is an GenericQueue instance we have just created above. Note that the GenericQueue is not a static class rather its a instance class unlike the SSQ. You have also noticed that the ms_when_last_call_made and ms_elapsed_since_last_call are pretty self-describing. get_random_id is reponsible for preparing new id for the newly enqueued call.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:b4286d51-b175-49f5-8944-59bed7e1fd96" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#0000FF;">var</span><span style="color:#000000;"> SequentialServiceQueue </span><span style="color:#000000;">=</span><span style="color:#000000;">
{
    timer_id: </span><span style="color:#0000FF;">null</span><span style="color:#000000;">,
    ms_when_last_call_made: </span><span style="color:#000000;">0</span><span style="color:#000000;">,          </span><span style="color:#008000;">//</span><span style="color:#008000;"> milliseconds (readonly)</span><span style="color:#008000;">
</span><span style="color:#000000;">    ms_elapsed_since_last_call: </span><span style="color:#000000;">0</span><span style="color:#000000;">,      </span><span style="color:#008000;">//</span><span style="color:#008000;"> milliseconds (readonly)</span><span style="color:#008000;">
</span><span style="color:#000000;">    running_task: </span><span style="color:#0000FF;">null</span><span style="color:#000000;">,
    interval: </span><span style="color:#000000;">10</span><span style="color:#000000;">,                       </span><span style="color:#008000;">//</span><span style="color:#008000;"> milliseconds</span><span style="color:#008000;">
</span><span style="color:#000000;">    queue: </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> GenericQueue(),

    get_random_id: </span><span style="color:#0000FF;">function</span><span style="color:#000000;">() {
        </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> min </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">1</span><span style="color:#000000;">;
        </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> max </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">10</span><span style="color:#000000;">;
        </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> Date().getTime() </span><span style="color:#000000;">+</span><span style="color:#000000;"> (Math.round((max </span><span style="color:#000000;">-</span><span style="color:#000000;"> min) </span><span style="color:#000000;">*</span><span style="color:#000000;"> Math.random() </span><span style="color:#000000;">+</span><span style="color:#000000;"> min));
    },</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>From the code below, as soon as any new call is enqueued, we check for if it is allowed to replace if already exists in the queue with the same name. If found any, we just update that, otherwise we create a brand new task and enqueue and start our updater which is the scheduler in our case.</p>
</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ae7c30d7-43e7-4af0-8770-8f7883c4cc68" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#000000;">nq: </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(name, replaceIfExists, timeout, code) {
    </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> id </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.get_random_id();

    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (replaceIfExists) {
        </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> isFound </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">false</span><span style="color:#000000;">;
        </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.queue.for_each(
            </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(index, element) {
                </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (element </span><span style="color:#000000;">!==</span><span style="color:#000000;"> undefined </span><span style="color:#000000;">&amp;&amp;</span><span style="color:#000000;"> element </span><span style="color:#000000;">!==</span><span style="color:#000000;"> </span><span style="color:#000000;">'</span><span style="color:#000000;">undefined</span><span style="color:#000000;">'</span><span style="color:#000000;"> </span><span style="color:#000000;">&amp;&amp;</span><span style="color:#000000;"> element.name </span><span style="color:#000000;">==</span><span style="color:#000000;"> name) {
                    element.id </span><span style="color:#000000;">=</span><span style="color:#000000;"> id;
                    element.replaceIfExists </span><span style="color:#000000;">=</span><span style="color:#000000;"> replaceIfExists;
                    element.timeout </span><span style="color:#000000;">=</span><span style="color:#000000;"> timeout;
                    element.code </span><span style="color:#000000;">=</span><span style="color:#000000;"> code;
                    isFound </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">true</span><span style="color:#000000;">;
                }
            });
    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Enqueue new task</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#000000;">!</span><span style="color:#000000;">isFound </span><span style="color:#000000;">||</span><span style="color:#000000;"> </span><span style="color:#000000;">!</span><span style="color:#000000;">replaceIfExists) {
        </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.queue.nq(
            {
                id: id,
                name: name,
                replaceIfExists: replaceIfExists,
                timeout: timeout,
                code: code
            });
    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> We have got new tasks, start the updater</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.startUpdater();

    </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> id;
},</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>The following is the core part of the class which is the scheduler. Inside startUpdater, it executes the block of code in every interval we defined before. And inside the looping code, we check for if there is already any running task, if yes we check for the timeout whether it should make a good timeout or not. Otherwise we let it run as it was. However, if there is no running task at this moment, we dequeue a task and start executing the code and set a starting time for that to keep track of how long it is being running.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:1696cc4d-c248-4621-9489-a8f1c75ff909" class="wlWriterSmartContent">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#000000;">detachTask: </span><span style="color:#0000FF;">function</span><span style="color:#000000;">(id) {
    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.dq(id);
    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.running_task </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">;
    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.ms_when_last_call_made </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;">;
    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.ms_elapsed_since_last_call </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;">;

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> See if we are done with the queued tasks</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.queue.is_empty())
        </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.stopUpdater();
},

startUpdater: </span><span style="color:#0000FF;">function</span><span style="color:#000000;">() {
    </span><span style="color:#0000FF;">var</span><span style="color:#000000;"> _self </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">this</span><span style="color:#000000;">;
    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.timer_id </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">) {
        </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.timer_id </span><span style="color:#000000;">=</span><span style="color:#000000;"> setInterval(
            </span><span style="color:#0000FF;">function</span><span style="color:#000000;">() {
                </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (_self.running_task </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">) {
                    </span><span style="color:#008000;">//</span><span style="color:#008000;"> We dont have any running task, lets make the first one</span><span style="color:#008000;">
</span><span style="color:#000000;">                    _self.running_task </span><span style="color:#000000;">=</span><span style="color:#000000;"> _self.queue.dq();
                    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (_self.running_task </span><span style="color:#000000;">!=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">) {
                        _self.ms_when_last_call_made </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> Date().getTime();
                        _self.running_task.code();
                    }
                }
                </span><span style="color:#0000FF;">else</span><span style="color:#000000;"> {
                    </span><span style="color:#008000;">//</span><span style="color:#008000;"> We have a running task already</span><span style="color:#008000;">
</span><span style="color:#000000;">                    _self.ms_elapsed_since_last_call </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> Date().getTime() </span><span style="color:#000000;">-</span><span style="color:#000000;"> _self.ms_when_last_call_made;

                    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Should the current task be skipped?</span><span style="color:#008000;">
</span><span style="color:#000000;">                    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (_self.ms_elapsed_since_last_call </span><span style="color:#000000;">&gt;</span><span style="color:#000000;"> _self.running_task.timeout)
                    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Time's up. leave the task alone. Let other tasks start executing.</span><span style="color:#008000;">
</span><span style="color:#000000;">                        _self.detachTask(_self.running_task.id);
                }
            }, _self.interval);
    }
},

stopUpdater: </span><span style="color:#0000FF;">function</span><span style="color:#000000;">() {
    </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.timer_id </span><span style="color:#000000;">!=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">) {
        clearInterval(</span><span style="color:#0000FF;">this</span><span style="color:#000000;">.timer_id)
        </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.timer_id </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">;
    }

    </span><span style="color:#0000FF;">this</span><span style="color:#000000;">.queue </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> GenericQueue();
},</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Keep an eye on my blog for continued development and improvements, and download CallQueue from: <a href="http://code.msdn.microsoft.com/callqueue">http://code.msdn.microsoft.com/callqueue</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=101&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>Client Perspective of Windows Azure Services Platform</title>
		<link>http://tanzimsaqib.wordpress.com/2008/11/14/client-perspective-of-windows-azure-services-platform/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/11/14/client-perspective-of-windows-azure-services-platform/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 11:07:47 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Azure]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/11/14/client-perspective-of-windows-azure-services-platform/</guid>
		<description><![CDATA[Windows Azure was announced on PDC 2008 (Oct 27) and will hopefully be released mid next year. You probably already know about Azure by this time. If no, I would like to quote some from www.azure.com as intro: The Azure Services Platform is an internet-scale cloud computing and services platform hosted in Microsoft data centers. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=90&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Windows Azure was announced on PDC 2008 (Oct 27) and will hopefully be released mid next year. You probably already know about Azure by this time. If no, I would like to quote some from <a target="_blank" href="http://www.azure.com">www.azure.com</a> as intro: The Azure Services Platform is an internet-scale cloud computing and services platform hosted in Microsoft data centers. The Azure Services Platform provides a range of functionality to build applications that span from consumer web to enterprise scenarios and includes a cloud operating system and a set of developer services. Fully interoperable through the support of industry standards and web protocols such as REST and SOAP, you can use the Azure services individually or together, either to build new applications or to extend existing ones.</p>
<p>Let us have a quick overview of the clients we usually use in our daily life, then we will explore the potential of Azure and what is waiting for us down to the road:</p>
<p><strong>Windows Client</strong></p>
<ul>
<li>Full capabilities, power, rich UI, high performance
<li>Ability to utilize local resources e.g. audio, camera.
<li>Capable of blending different hardware and software resulting in amazing applications
<li>Private data, reliable and fastest
<li>Personal, trusted and full control </li>
</ul>
<p><strong>Web Client</strong></p>
<ul>
<li>Data accessibility, availability
<li>Connect with devices, data services, friends
<li>Sociability, ability to share
<li>Interaction, collaboration, email, instant messaging
<li>Searchable
<li>Data security is questionable
<li>Open formats and standards for data exchange </li>
</ul>
<p><strong>Mobile Client</strong></p>
<ul>
<li>Low capability compared to regular PC horsepower
<li>Portable: palm reach
<li>Smart device while powered by web. e.g. Search for restaurants nearby
<li>Your 24/7 companion </li>
</ul>
<p><strong>Smart Client</strong></p>
<p>Did we forget about Smart Clients? These applications are usually Windows Forms application which take all the advantages of Windows Client including offline storage, utilization of local resources as well as the goodness of internet connectivity. The Smart Client was coined few years ago, but for .NET developers all Windows Client is pretty much generally considered as Smart Clients. The idea behind Smart Client was to utilize full local computing capabilities and exploit the web&#8217;s accessibility, availability and nature of openness through XML Web Services to developers build great software.</p>
<p><strong>Mesh</strong></p>
<p>An important part of Live Services is Mesh, which enables developers to build application for consumer devices which are physically close to them. If you are at home you would be able to access through Windows Client, if you are on the go, you would be through Mobile Client, if you have Internet access only, you would be able to avail the service through Internet. Mesh allows us to get all those devices get connected, exchange data and stay synchronized. You can even add a Mac as device into Mesh to work with. Data communication among devices through Mesh is secured, since the data transferred between them are surely encrypted.</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/11/image.png"><img style="border-width:0;" border="0" alt="image" src="http://tanzimsaqib.files.wordpress.com/2008/11/image-thumb.png?w=459&#038;h=270" width="459" height="270"></a> </p>
<p>The following screenshots show how you can sync your local PC using Mesh and how your friends can share files or work on files you gave access them to:</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-share-newpost.jpg"><img style="border-width:0;" border="0" alt="demo-howto-share-newpost" src="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-share-newpost-thumb.jpg?w=343&#038;h=334" width="343" height="334"></a> <a href="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-sync-addfolder.jpg"><img style="border-width:0;" border="0" alt="demo-howto-sync-addfolder" src="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-sync-addfolder-thumb.jpg?w=373&#038;h=333" width="373" height="333"></a> </p>
<p><strong>Goodness of all Clients</strong></p>
<p>Windows Azure Services Platform is actually an array of technologies, consists of set of tools, and extremely scalable on demand powered by Microsoft datacenters and their ingenious virtualization technology. The core of this platform is to provide user with best experience taking the goodies of each client platform we use in our daily life. Combining the power of HTTP, XML, REST and WebServices Azure lets developers to build cloud enabled applications. The basic advantage of using open and standard protocol for communicating between clients is decreased dependency on the tools, languages or platform of the client. Client could be made by Ruby, Python or it could be in iPhone. </p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/11/image2.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;" border="0" alt="image" src="http://tanzimsaqib.files.wordpress.com/2008/11/image-thumb2.png?w=520&#038;h=513" width="520" height="513"></a> </p>
<p>Azure enables you to store your data in the cloud. No matter which client you used to work on your data, if you change your client, time-space, you will be able to get back to the same data once you worked on some other devices/OS.</p>
<p><strong>Why hosting cloud application with Microsoft?</strong></p>
<p>Microsoft has 460 millions Live users to date backed up by hundreds of thousands of servers in their datacenters. How many times have you seen Microsoft&#8217;s sites down? I have not seen many times in life. So, their ability to host, manage super scalable and high traffic websites is not questionable at all. Who else can be a better host of your next big application other than Microsoft?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=90&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/11/14/client-perspective-of-windows-azure-services-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-share-newpost-thumb.jpg" medium="image">
			<media:title type="html">demo-howto-share-newpost</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/demo-howto-sync-addfolder-thumb.jpg" medium="image">
			<media:title type="html">demo-howto-sync-addfolder</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/image-thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Cloudship: Membership Provider for the Cloud</title>
		<link>http://tanzimsaqib.wordpress.com/2008/11/14/cloudship-membership-provider-for-the-cloud/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/11/14/cloudship-membership-provider-for-the-cloud/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 05:03:53 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Azure]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/11/14/cloudship-membership-provider-for-the-cloud/</guid>
		<description><![CDATA[Planning to move to the Azure Cloud, but already tied to the Membership API? I have recently written an article on Windows Azure which guides you to build a complete Membership provider library which can be leveraged by existing application to link to Microsoft’s cloud platform Windows Azure with no friction. Goals of this project [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=81&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Planning to move to the Azure Cloud, but already tied to the Membership API? I have recently written an article on Windows Azure which guides you to build a complete Membership provider library which can be leveraged by existing application to link to Microsoft’s cloud platform Windows Azure with no friction. Goals of this project were to be able to use regular ASP.NET Login controls, existing Membership code e.g. Membersip.UpadateUser(), MembershipUser.ChangePassword().</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/11/azure-inheritance.png"><img style="border-width:0;" height="65" alt="azure_inheritance" src="http://tanzimsaqib.files.wordpress.com/2008/11/azure-inheritance-thumb.png?w=446&#038;h=65" width="446" border="0"></a> </p>
<p>Last, but not least one of the major goals was ease of use. No matter which suite of controls you use: ASP.NET AJAX or MVC, Cloudship can be leveraged as your Membership provider. To install it, into your existing application, simply: </p>
<p>1. Reference the DLL<br />2. Insert few lines inside web.config<br />3. You are good to go
<p>In this article you will learn how to implement your own Membership API, thus you can start moving you application data to the Azure Cloud – the future of development and business with Microsoft. Here you go &#8211; <a href="http://dotnetslackers.com/articles/aspnet/Azure-Cloudship-Membership-Provider-for-the-Cloud.aspx" target="_blank">Cloudship: Membership Provider for the Cloud</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=81&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/11/14/cloudship-membership-provider-for-the-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/azure-inheritance-thumb.png" medium="image">
			<media:title type="html">azure_inheritance</media:title>
		</media:content>
	</item>
		<item>
		<title>Building applications for Windows Azure</title>
		<link>http://tanzimsaqib.wordpress.com/2008/11/07/building-applications-for-windows-azure/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/11/07/building-applications-for-windows-azure/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 09:14:39 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Azure]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/11/07/building-applications-for-windows-azure/</guid>
		<description><![CDATA[Windows Azure is an upcoming operating system for the cloud from Microsoft, announced on October 27 at PDC. Windows Azure provides developers with on-demand compute and storage to host, scale, and manage Web applications on the Internet through Microsoft data centers. Azure goes beyond what other providers, such as Rackspace&#8217;s Mosso or Amazon&#8217;s EC2, offer. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=78&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Windows Azure is an upcoming operating system for the cloud from Microsoft, announced on October 27 at PDC. Windows Azure provides developers with on-demand compute and storage to host, scale, and manage Web applications on the Internet through Microsoft data centers. Azure goes beyond what other providers, such as Rackspace&#8217;s Mosso or Amazon&#8217;s EC2, offer. First, it will be available with a complete suite of tools and technologies for building your next big cloud application. Second, the Azure platform&#8217;s goal is to support all developers and their choice of IDE, language, and technology; meaning that you can use your favorite tools for all kinds of development as well as Python, PHP, Ruby, Eclipse and so on. It supports popular standards and protocols including SOAP, REST, and XML. Using the Windows Azure tools, developers can build, debug, and deploy to Windows Azure directly from their existing development environment.</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/11/azuretodolist.png"><img style="border-width:0;" height="402" alt="AzureTodolist" src="http://tanzimsaqib.files.wordpress.com/2008/11/azuretodolist-thumb.png?w=600&#038;h=402" width="600" border="0"></a> </p>
<p>I have written an article &#8220;<a href="http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx" target="_blank">Building applications for Windows Azure</a>&#8221; which will walk you through the steps to build an application from scratch on the recently released Windows Azure CTP, Microsoft’s answer to cloud computing. This application will let users add tasks into their Todolists and track them at a later time. The objective of this application is not to use any local data storage like SQL database. Instead, it will store and retrieve data from the cloud which means no matter which language/platform you write your application on, it will be able to access the data. For instance, if you would like to develop an iPhone application which will be able to play with your saved tasks on the go, you will be able to do so. Hope you will enjoy the article.</p>
<p>Link: <a href="http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx">http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=78&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/11/07/building-applications-for-windows-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/11/azuretodolist-thumb.png" medium="image">
			<media:title type="html">AzureTodolist</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing DevelopmentStorage&#8217;s database cannot be found problem on Windows Azure</title>
		<link>http://tanzimsaqib.wordpress.com/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 09:00:13 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Azure]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure/</guid>
		<description><![CDATA[This could be a common problem who are not using SQL Express. If you run an Azure application you may find it seeks for SQL Express instance in your machine if you do not have already. You may also find &#8220;An error occurred while processing this request.&#8221; error due to this reason while you try [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=75&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This could be a common problem who are not using SQL Express. If you run an Azure application you may find it seeks for SQL Express instance in your machine if you do not have already. You may also find &#8220;An error occurred while processing this request.&#8221; error due to this reason while you try creating tables from your models by StorageClient.TableStorage.CreateTablesFromModel. All you need to do is fire up Visual Studio and open the config file for DevelopmentStorage at C:\Program Files\Windows Azure SDK\v1.0\bin\DevelopmentStorage.exe.config. Now modify the connection string and the <em>dbServer</em> attribute of the service tag for Table, and save.</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:743cfbb2-9483-4a59-ace5-c8aa678b4d2f" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:none;">
<div><span style="color:#000000;">  </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">connectionStrings</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">add </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;DevelopmentStorageDbConnectionString&quot;</span><span style="color:#FF0000;">
         connectionString</span><span style="color:#0000FF;">=&quot;Data Source=.\SQLEXPRESS;Initial Catalog=DevelopmentStorageDb;Integrated Security=True&quot;</span><span style="color:#FF0000;">
         providerName</span><span style="color:#0000FF;">=&quot;System.Data.SqlClient&quot;</span><span style="color:#FF0000;"> </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
  </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">connectionStrings</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">

  </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">appSettings</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">add </span><span style="color:#FF0000;">key</span><span style="color:#0000FF;">=&quot;ClientSettingsProvider.ServiceUri&quot;</span><span style="color:#FF0000;"> value</span><span style="color:#0000FF;">=&quot;&quot;</span><span style="color:#FF0000;"> </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
  </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">appSettings</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">

  </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">developmentStorageConfig</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">services</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">service </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;Blob&quot;</span><span style="color:#FF0000;">
               url</span><span style="color:#0000FF;">=&quot;http://127.0.0.1:10000/&quot;</span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">service </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;Queue&quot;</span><span style="color:#FF0000;">
               url</span><span style="color:#0000FF;">=&quot;http://127.0.0.1:10001/&quot;</span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">service </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;Table&quot;</span><span style="color:#FF0000;">
               url</span><span style="color:#0000FF;">=&quot;http://127.0.0.1:10002/&quot;</span><span style="color:#FF0000;">
               dbServer</span><span style="color:#0000FF;">=&quot;localhost\SQLExpress&quot;</span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">services</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
    ...
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Restart Visual Studio and open up the Azure project again, now you should be able to run the DevelopmentStorage with the existing database installation of your PC.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=75&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple Form Validation &#8211; A Reflection based approach</title>
		<link>http://tanzimsaqib.wordpress.com/2008/03/28/simple-form-validation-a-reflection-based-approach-2/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/03/28/simple-form-validation-a-reflection-based-approach-2/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 17:02:24 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/03/28/simple-form-validation-a-reflection-based-approach-2/</guid>
		<description><![CDATA[Are you tired of placing multiple Validation controls on Form? If you are bored of following scenario like me, keep on reading the post:
 
A simple Email address validation can consist of whether

The field is empty
Longer than limit
Email address format is invalid
Already in use

Ordinary solution to this problem is placing multiple validation controls for a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=70&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Are you tired of placing multiple Validation controls on Form? If you are bored of following scenario like me, keep on reading the post:</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/03/validators.png"><img style="border-width:0;" height="82" alt="Validators" src="http://tanzimsaqib.files.wordpress.com/2008/03/validators-thumb.png?w=365&#038;h=82" width="365" border="0"></a> </p>
<p>A simple Email address validation can consist of whether</p>
<ul>
<li>The field is empty
<li>Longer than limit
<li>Email address format is invalid
<li>Already in use</li>
</ul>
<p>Ordinary solution to this problem is placing multiple validation controls for a single TextBox. You can simply it by replacing all with a single Custom Validator. Our goal is to reduce amount of controls on the form to keep it simple. To do that, we would have to write code for Custom Validator that does it all. We also would like to write minimum code to validate the control without compromising manageability. Let us assume we would write the following code inside the ServerValidate of that control:</p>
<pre><span style="color:blue;">protected void </span>cvEmailAddress_ServerValidate(<span style="color:blue;">object </span>source, <span style="color:#2b91af;">ServerValidateEventArgs </span>args)
{
    <span style="color:#2b91af;">ValidationController</span>.ValidateControl&lt;<span style="color:#2b91af;">ProfileValidator</span>&gt;(cvEmailAddress, <span style="color:#2b91af;">ProfileValidator</span>.<span style="color:#2b91af;">Fields</span>.EmailAddress.ToString(), args);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Let us declare a ValidationErrorResult object that contains error messages and text to display in the UI:</p>
<pre><span style="color:blue;">public sealed class </span><span style="color:#2b91af;">ValidationErrorResult
</span>{
    <span style="color:blue;">public string </span>ErrorMessage { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }
    <span style="color:blue;">public string </span>Text { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>And an Attribute which would be used to tag a specific method which would be responsible for validation of particular control:</p>
<pre>[<span style="color:#2b91af;">AttributeUsage</span>(<span style="color:#2b91af;">AttributeTargets</span>.Method, Inherited = <span style="color:blue;">false</span>, AllowMultiple = <span style="color:blue;">true</span>)]
<span style="color:blue;">public sealed class </span><span style="color:#2b91af;">ValidationMethodAttribute </span>: <span style="color:#2b91af;">Attribute
</span>{
    <span style="color:blue;">public </span>ValidationMethodAttribute(<span style="color:blue;">string </span>fieldName)
    {
        <span style="color:blue;">this</span>.FieldName = fieldName;
    }

    <span style="color:blue;">public string </span>FieldName { <span style="color:blue;">get</span>; <span style="color:blue;">private set</span>; }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>If you are already familiar with Attirbute based programming, I hope you know the attribute of this piece of code is in fact <span style="color:#2b91af;">ValidationMethod</span>. We will soon see how to use this. The following is the method that checks the value and make a list of <span style="color:#2b91af;">ValidationErrorResult </span>that consists of which rules got failed. Notice that the <span style="color:#2b91af;">ValidationMethod</span> attribute contains the field name of the object which determines no matter whatever your method name is, that field name helps Validation controller to find this method out for validation.</p>
<pre>[<span style="color:#2b91af;">ValidationMethod</span>(<span style="color:#a31515;">"Email"</span>)]
<span style="color:blue;">public static </span><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">ValidationErrorResult</span>&gt; ValidateEmail(<span style="color:blue;">object </span>value)
{
    <span style="color:blue;">var </span>email = value <span style="color:blue;">as string</span>;
    <span style="color:blue;">var </span>results = <span style="color:blue;">new </span><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">ValidationErrorResult</span>&gt;();

    <span style="color:green;">// Blank
    </span><span style="color:blue;">if </span>(<span style="color:blue;">string</span>.IsNullOrEmpty(email))
        results.Add(<span style="color:blue;">new </span><span style="color:#2b91af;">ValidationErrorResult</span>()
        {
            ErrorMessage = <span style="color:#a31515;">"You did not provide an Email Address."</span>,
            Text = <span style="color:#a31515;">"Cannot be left blank"
        </span>});

    <span style="color:green;">// Length 128
    </span><span style="color:blue;">if </span>(email.Length &gt; 128)
        results.Add(<span style="color:blue;">new </span><span style="color:#2b91af;">ValidationErrorResult</span>()
        {
            ErrorMessage = <span style="color:#a31515;">"You exceeded length limit."</span>,
            Text = <span style="color:#a31515;">"Keep it less than 129 characters"
        </span>});

    <span style="color:green;">// Valid Email Address
    </span><span style="color:blue;">if </span>(!<span style="color:#2b91af;">Regex</span>.IsMatch(email, <span style="color:#a31515;">"^[\\w\\.\\-]+@[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]{1,})*(\\.[a-zA-Z]{2,3}){1,2}$"</span>))
        results.Add(<span style="color:blue;">new </span><span style="color:#2b91af;">ValidationErrorResult</span>()
        {
            ErrorMessage = <span style="color:#a31515;">"You provided an invalid Email Address."</span>,
            Text = <span style="color:#a31515;">"Invalid Email Address"
        </span>});

    <span style="color:green;">// Is Already In Use
    </span><span style="color:blue;">if </span>(IsAlreadyInUse(email))
        results.Add(<span style="color:blue;">new </span><span style="color:#2b91af;">ValidationErrorResult</span>()
        {
            ErrorMessage = <span style="color:#a31515;">"You provided an invalid Email Address."</span>,
            Text = <span style="color:#a31515;">"Invalid Email Address"
        </span>});

    <span style="color:blue;">return </span>results;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Here is the ValidationController which goes through the Validation class and looks for the method that has the attribute which validates the control&#8217;s value.</p>
<pre><span style="color:blue;">public class </span><span style="color:#2b91af;">ValidationController
</span>{
    <span style="color:blue;">public static </span><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">ValidationErrorResult</span>&gt; Validate&lt;T&gt;(<span style="color:blue;">string </span>fieldName, <span style="color:blue;">object </span>value)
    {
        <span style="color:blue;">var </span>results = <span style="color:blue;">new </span><span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">ValidationErrorResult</span>&gt;();
        <span style="color:blue;">var </span>type = <span style="color:blue;">typeof</span>(T);
        <span style="color:blue;">var </span>methods = type.GetMethods(BindingFlags.Static | BindingFlags.Public);

        <span style="color:blue;">var </span>method = methods.Single&lt;MethodInfo&gt;(<span style="color:blue;">delegate</span>(MethodInfo m)
        {
            <span style="color:blue;">return </span>((<span style="color:#2b91af;">ValidationMethodAttribute</span>[])m.GetCustomAttributes(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">ValidationMethodAttribute</span>), <span style="color:blue;">false</span>))[0].FieldName == fieldName;
        });

        <span style="color:blue;">return </span>(<span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">ValidationErrorResult</span>&gt;)method.Invoke(<span style="color:blue;">null</span>, <span style="color:blue;">new object</span>[] { value });
    }

    <span style="color:blue;">public static void </span>ValidateControl&lt;T&gt;(<span style="color:#2b91af;">CustomValidator </span>validator, <span style="color:blue;">string </span>fieldName, <span style="color:#2b91af;">ServerValidateEventArgs </span>args)
    {
        <span style="color:blue;">var </span>results = Validate&lt;T&gt;(fieldName, args.Value);

        <span style="color:blue;">if </span>(!(args.IsValid = !(results.Count &gt; 0)))
        {
            validator.ErrorMessage = results[0].ErrorMessage;
            validator.Text = results[0].Text;
        }
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/70/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/70/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=70&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/03/28/simple-form-validation-a-reflection-based-approach-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/03/validators-thumb.png" medium="image">
			<media:title type="html">Validators</media:title>
		</media:content>
	</item>
		<item>
		<title>Use your personal blog with Windows Live Writer</title>
		<link>http://tanzimsaqib.wordpress.com/2008/03/03/use-your-personal-blog-with-windows-live-writer/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/03/03/use-your-personal-blog-with-windows-live-writer/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 20:03:38 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/03/03/use-your-personal-blog-with-windows-live-writer/</guid>
		<description><![CDATA[I&#8217;m very glad to tell you that your &#8220;.NET Research&#8221; personal blog is compatible with Windows Live Writer. You can compose, format, insert photos inside your posts offline and publish when you become online totally from this client without even opening the &#8220;.NET Research&#8221; site. Let us the steps to do this assuming you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=66&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m very glad to tell you that your <a href="http://dotnetbd.org/" target="_blank">&#8220;.NET Research&#8221;</a> personal blog is compatible with <a href="http://writer.live.com/" target="_blank">Windows Live Writer</a>. You can compose, format, insert photos inside your posts offline and publish when you become online totally from this client without even opening the &#8220;.NET Research&#8221; site. Let us the steps to do this assuming you have properly installed Windows Live Writer.</p>
<p>Step 1. Run Windows Live Writer and Weblog &gt; Add Weblog account..</p>
<p>Step 2. Choose another weblog service like the following screen and click Next:</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/03/step2.jpg"><img style="border-width:0;" height="270" alt="Step2" src="http://tanzimsaqib.files.wordpress.com/2008/03/step2-thumb.jpg?w=310&#038;h=270" width="310" border="0"></a> </p>
<p>Step 3. Now type <a href="http://dotnetbd.org">http://dotnetbd.org</a> as your Weblog Homepage URL, enter your credential like here I used as <em>admin</em>:</p>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/03/step3.jpg"><img style="border-width:0;" height="271" alt="Step3" src="http://tanzimsaqib.files.wordpress.com/2008/03/step3-thumb.jpg?w=310&#038;h=271" width="310" border="0"></a> </p>
<p>Now Windows Live Writer will download some necessary files to work offline and will appear with a white blank screen for you to write your first post! That&#8217;s it. These simple two steps will enable you to use this powerful tool to work with your &#8220;.NET Research&#8221; personal blog. Happy blogging!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=66&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/03/03/use-your-personal-blog-with-windows-live-writer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/03/step2-thumb.jpg" medium="image">
			<media:title type="html">Step2</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/03/step3-thumb.jpg" medium="image">
			<media:title type="html">Step3</media:title>
		</media:content>
	</item>
		<item>
		<title>LINQ to Flickr</title>
		<link>http://tanzimsaqib.wordpress.com/2008/03/01/linq-to-flickr/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/03/01/linq-to-flickr/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 16:06:30 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/03/01/linq-to-flickr/</guid>
		<description><![CDATA[One of my colleagues Mehfuz Hossain developed a wonderful open source project which allows you to query Flickr photos by LINQ, also lets you insert, delete photos directly to/from Flickr. You wonder how to extend LINQ in such an amazing way? It’s easy by writing your own custom LINQ provider, which was not-so-easy until he [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=61&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of my colleagues <a href="http://weblogs.asp.net/mehfuzh">Mehfuz Hossain</a> developed a wonderful open source project which allows you to query Flickr photos by LINQ, also lets you insert, delete photos directly to/from Flickr. You wonder how to extend LINQ in such an amazing way? It’s easy by writing your own custom LINQ provider, which was not-so-easy until he came up with another handy open source project named <a href="http://www.codeplex.com/linqextender">LINQ Extender</a><a href="http://www.codeplex.com/linqextender"></a>. He did all the expression parsing stuff to ease our pain. Now you can make your own LINQ to Anything using this so easily.
<p>For your heads up on LINQ extenders, here <a href="http://dotnetslackers.com/articles/csharp/CreatingCustomLINQProviderUsingLinqExtender.aspx">he wrote an article</a> and <a href="http://www.codeplex.com/LINQFlickr">LINQ to Flickr</a>, open source project is hosted at Codeplex.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=61&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/03/01/linq-to-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>A &quot;transactional&quot; generic DbHelper for LINQ to SQL</title>
		<link>http://tanzimsaqib.wordpress.com/2008/02/06/a-transactional-generic-dbhelper-for-linq-to-sql/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/02/06/a-transactional-generic-dbhelper-for-linq-to-sql/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 07:35:10 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/02/06/a-transactional-generic-dbhelper-for-linq-to-sql/</guid>
		<description><![CDATA[In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=59&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language. You may want to make a data access layer that separates the data operation from business layer like the following:</p>
<pre>DbHelper.Insert&lt;<font color="#2b91af">Student</font>&gt;(
    new <font color="#2b91af">Student</font>()
    {
        FirstName = <span style="color:#a31515;">"Tanzim"</span>,
        LastName = <span style="color:#a31515;">"Saqib"</span>,
        Email = <span style="color:#a31515;">"me@TanzimSaqib.com"</span>,
        Website = <span style="color:#a31515;">"http://www.TanzimSaqib.com"</span></pre>
<pre>}, <span style="color:blue;">true</span>);    <span style="color:green;">// Use Transaction?</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p>To make use of such transactional generic DbHelper, you might want to write a singeton DbHelper class like the following. You might notice that the class is singleton, it&#8217;s static and the DataContext is being used is private, and only initialized using the connection string if not yet.</p>
<pre><span style="color:blue;">public static class </span><span style="color:#2b91af;">DbHelper
</span>{
    <span style="color:blue;">private const string </span>CONNECTION_CONFIG_NAME = <span style="color:#a31515;">"StudentServerConnectionString"</span>;

    <span style="color:blue;">private static </span>StudentServerDataContext _StudentServerDataContext = <span style="color:blue;">null</span>;

    <span style="color:blue;">public static </span>StudentServerDataContext GetDataContext()
    {
        <span style="color:blue;">if</span>(_StudentServerDataContext == <span style="color:blue;">null</span>)
            _StudentServerDataContext = <span style="color:blue;">new </span>StudentServerDataContext
                (<span style="color:#2b91af;">ConfigurationManager</span>.ConnectionStrings
                [CONNECTION_CONFIG_NAME].ConnectionString);

        <span style="color:blue;">return </span>_StudentServerDataContext;
    }

    <span style="color:blue;">public static void </span>CleanUp()
    {
        _StudentServerDataContext.Dispose();
        _StudentServerDataContext = <span style="color:blue;">null</span>;
    }

    <span style="color:green;">// ... code edited to save space</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>On application wide error or on end you can dispose the context so CleanUp method is useful here. To implement an Insert method see the following. You will find I have used a TransactionScope which ensures that the transaction is taking place without any interruption. If there is really any error the scope.Complete() method never gets invoked. This is how it ensures that the code inside the TransactionScope is taking place as a transaction. It is available from .NET 2.0 framework.</p>
<pre><span style="color:blue;">public static void </span>Insert&lt;T&gt;(T t, <span style="color:blue;">bool </span>isTransactional) <span style="color:blue;">where </span>T : <span style="color:blue;">class
</span>{
    <span style="color:blue;">if </span>(isTransactional)
    {
        <span style="color:blue;">using </span>(<span style="color:blue;">var </span>scope = <span style="color:blue;">new </span><span style="color:#2b91af;">TransactionScope</span>())
        {
            Insert&lt;T&gt;(t);

            <span style="color:green;">// On any Exception, Complete() method won't be invoked.
            // So, the transaction will be automatically rollbacked.
            </span>scope.Complete();
        }
    }
    <span style="color:blue;">else
        </span>Insert&lt;T&gt;(t);
}

<span style="color:blue;">public static void </span>Insert&lt;T&gt;(T t) <span style="color:blue;">where </span>T : <span style="color:blue;">class
</span>{
    <span style="color:blue;">using </span>(<span style="color:blue;">var </span>db = GetDataContext())
    {
        db.GetTable&lt;T&gt;().InsertOnSubmit(t);

        <span style="color:blue;">try
        </span>{
            db.SubmitChanges();
        }
        <span style="color:blue;">catch </span>(<span style="color:#2b91af;">Exception </span>e)
        {
            <span style="color:green;">// TODO: log Exception
            </span><span style="color:blue;">throw </span>e;
        }
    }
}</pre>
<p>I did not show other methods as part of the CRUD implementation. The rest is left open for you to implement.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/59/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/59/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=59&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/02/06/a-transactional-generic-dbhelper-for-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>[New Article] 7 ways to do Performance Optimization of an ASP.NET 3.5 Web 2.0 portal</title>
		<link>http://tanzimsaqib.wordpress.com/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an-aspnet-35-web-20-portal/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an-aspnet-35-web-20-portal/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 05:31:00 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an-aspnet-35-web-20-portal/</guid>
		<description><![CDATA[Web 2.0 applications are widely developed. These applications often work with third party contents, aggregate them, make various use of them and then make something useful and meaningful to the users. For the past few years, developers were also engaged with such endeavors and a lot of their websites have not addressed performance issues, thus [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=58&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Web 2.0 applications are widely developed. These applications often work with third party contents, aggregate them, make various use of them and then make something useful and meaningful to the users. For the past few years, developers were also engaged with such endeavors and a lot of their websites have not addressed performance issues, thus resulting in an unpleasant experience to the users.</p>
<p>Performance is a vast area and great results can never be achieved by a silver bullet. <a href="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx" target="_blank">This article</a> explores some of the key performance issues that can occur while developing a Web 2.0 portal using server side multithreading and caching. It also demonstrates model driven application development using Windows Workflow Foundation. </p>
<p>URL: <a title="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx" href="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx">http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=58&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an-aspnet-35-web-20-portal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
	</channel>
</rss>