<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7478161890317222188</id><updated>2012-02-14T16:25:23.539+05:30</updated><category term='web application'/><category term='discussion'/><category term='dot net 3.5'/><category term='news'/><category term='going forward'/><category term='Windows Workflow Foundation'/><category term='Expression Blend'/><category term='column'/><category term='service'/><category term='Error loading workflow'/><category term='c# 3.0'/><category term='cannot open c# project in orcas beta 2'/><category term='obvious'/><category term='windows 7'/><category term='c#'/><category term='pavan kulkarni'/><category term='WF'/><category term='resources'/><category term='.net'/><category term='can not find workflow instance'/><category term='multiple inheritence'/><category term='basics'/><category term='C# basics'/><category term='codeproject'/><category term='multiple declaration'/><category term='LINQ'/><category term='Expression Suite'/><category term='reading'/><category term='dot net 3.0'/><category term='type'/><category term='datatable'/><category term='security'/><category term='links'/><category term='compile'/><category term='Select'/><category term='issue loading workflow'/><category term='hidden column issue'/><category term='dlinq'/><category term='language integrated query'/><category term='tutorials'/><category term='Where'/><category term='entry point'/><category term='concepts'/><category term='metadata path is not valid'/><category term='Pavan'/><category term='asp.net'/><category term='Blackcomb Vienna'/><category term='framework'/><category term='the contextual keyword var may only appear within a local variable declaration'/><category term='error opening c# project in orcas beta 2'/><category term='c#.net'/><category term='OS'/><category term='base type'/><category term='expression trees'/><category term='Vista'/><category term='Microsoft'/><category term='mistake'/><category term='introduction'/><category term='can not load workflow'/><category term='lambda expressions'/><category term='SilverLight'/><category term='xlinq'/><category term='block of code in lambda expressions'/><category term='event'/><category term='control statements in lambda expessions'/><category term='Runtime capabilities are not available with this type'/><category term='10 things'/><category term='Workflow with id not found in persistance store'/><category term='value type'/><category term='Can not retrieve values from grid view'/><category term='pavan kumar kulkarni'/><category term='class'/><category term='internet'/><category term='what is'/><category term='Runtime'/><category term='main method'/><category term='weblinq'/><category term='grid view'/><category term='dot net'/><category term='not so obvious'/><category term='null value from grid view'/><category term='System.Object'/><category term='primary key'/><category term='System.ValueType'/><category term='specified named connection is either not found in the configuration'/><category term='main'/><category term='videos'/><category term='program'/><category term='reference type'/><category term='MS'/><category term='make sure the application for the project type (.csproj) is installed'/><category term='the application for project is not installed'/><category term='book'/><category term='blog'/><category term='var'/><category term='cannot get values from grid view'/><category term='anonymous methods'/><category term='entity framework'/><category term='multiple entry points'/><category term='state-machine workflow'/><title type='text'>Not So Obvious...</title><subtitle type='html'>"Every dusk has a dawn"</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-6316920482849075488</id><published>2008-01-22T21:14:00.000+05:30</published><updated>2008-01-22T21:25:16.746+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='Blackcomb Vienna'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='MS'/><title type='text'>Successor to Windows Vista</title><content type='html'>Not sure for how many this will come as a shock. For me, it definitely did!&lt;br /&gt;&lt;br /&gt;The next edition of Windows, i.e. the successor to Vista, is not only under development umbrella but started to ship too. The  first milestone (M1) has been shipped to MS partners and is available in English only for both x86 and x64 machines. And it's scheduled to do a RTM in H2 2009. It was originally supposed to RTM in 2010 but looks like MS is pulling strings pretty hard.&lt;br /&gt;&lt;br /&gt;Not much of information is available as of yet as to what all the new version carries. But since we have some tie-ups with MS, looks-like I can get my hands-on it. 09-10 is going be one heck of a year for us as well as MS, with Rosario also set to be released.&lt;br /&gt;&lt;br /&gt;Keep watching this space for more information on what the new OS is all about.&lt;br /&gt;&lt;br /&gt;By the way, it's called &lt;strong style="font-weight: normal; font-style: italic; color: rgb(0, 0, 153);"&gt;Windows 7  (previously code-named Blackcomb Vienna)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Source: http://www.tgdaily.com&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-6316920482849075488?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/6316920482849075488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=6316920482849075488' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6316920482849075488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6316920482849075488'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2008/01/successor-to-windows-vista.html' title='Successor to Windows Vista'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-150360293772776315</id><published>2008-01-22T20:54:00.000+05:30</published><updated>2008-01-22T21:13:06.757+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='blog'/><category scheme='http://www.blogger.com/atom/ns#' term='discussion'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='internet'/><category scheme='http://www.blogger.com/atom/ns#' term='codeproject'/><category scheme='http://www.blogger.com/atom/ns#' term='reading'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>How many still read books?</title><content type='html'>&lt;span style=";font-family:georgia;font-size:100%;"  &gt;An interesting discussion is brewing up at &lt;a href="http://www.codeproject.com/Lounge.aspx?msg=2393333#xx2393333xx"&gt;codeproject.com&lt;/a&gt;. The discussion is about &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);font-family:arial;font-size:100%;"  &gt;how many people still read those "hard paper books"?&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt; How many of us still do it? I do it. Probably 1 book a week :)  I know it sounds unbelievable but its true. No doubt, I have started this initiative pretty recently. I have 4 books now under this belt. But, anyway, that's not the topic right now.&lt;br /&gt;&lt;br /&gt;Most of the time people think that, in this blog-savvy world, there is hardly anyone left who reads books (for whatever reason!). But I was surprised to see that MS MVPs (people chipping-in to the discussion at codeproject) still find time to read books, around 10-50 per year. thats a pretty good score, considering that an year has around 52 weeks. So a book-a-week.&lt;br /&gt;&lt;br /&gt;So, if you look at it the other way round, then &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;looks like I'm on my way to become a MS MVP&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt; :) :) :)&lt;br /&gt;&lt;br /&gt;Wonderful to know that I have company! Oh no, not as MVPs but as book readers :)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-150360293772776315?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/150360293772776315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=150360293772776315' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/150360293772776315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/150360293772776315'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2008/01/how-many-still-read-books.html' title='How many still read books?'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-5533236796363296618</id><published>2007-11-16T11:17:00.001+05:30</published><updated>2007-11-16T12:01:46.134+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='web application'/><category scheme='http://www.blogger.com/atom/ns#' term='entity framework'/><category scheme='http://www.blogger.com/atom/ns#' term='specified named connection is either not found in the configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='metadata path is not valid'/><title type='text'>Making Entity Framework work with a Web Application</title><content type='html'>&lt;span style="font-family:arial;"&gt;Making Entity Framework (EFW) work with a web application was the toughest (relatively) of the lot (Win App, Console App etc). &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;To get it working for any type of app, these 2 steps are sufficient:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;Add the app.config of the EFW project to your app. If you already have a app.config, then add only the "connectionStrings" node of it.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;Copy the c/m/s (.csdl, .msl and .ssdl) files to the bin directory, where the executable of the app resides.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;But if you have to get this working for a web app, then&lt;/span&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;Add the "connectionStrings" node to your web app's web.config.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;Copy c/m/s files to App_Data folder&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;Change the string in "connectionStrings" node &lt;strong&gt;From&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;".\EFWSampleDb.csdl.\EFWSampleDb.ssdl.\EFWSampleDb.msl&lt;add providername="System.Data.EntityClient" connectionstring="'metadata=" name="EFWSampleDbEntities" string="Data Source=hydhtc47846;Initial Catalog=EFWSampleDb;Integrated Security=True" provider="System.Data.SqlClient;provider"&gt;"&lt;br /&gt;&lt;add providername="System.Data.EntityClient" connectionstring="'metadata=" name="EFWSampleDbEntities" string="Data Source=hydhtc47846;Initial Catalog=EFWSampleDb;Integrated Security=True" provider="System.Data.SqlClient;provider"&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;&lt;strong&gt;To&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;add connectionstring="" name="EFWSampleDbEntities" metadata="&lt;strong"&gt;"DataDirectoryEFWSampleDb.csdlDataDirectoryEFWSampleDb.ssdlDataDirectoryEFWSampleDb.msl"&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Alternately, instead of "|DataDirectory|EFWSampleDb.csdl" you can also say "~\App_Data\EFWSampleDb.csdl". ("~" refers to the root directory of the web app). So, this essentially means that you can have the m/s/l files in any directory, and not necessarily in App_Data, and reference it in web.config.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Failing to do the above steps may error out saying:&lt;/p&gt;&lt;p&gt;&lt;em&gt;"The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource."&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;OR&lt;/p&gt;&lt;p&gt;&lt;em&gt;"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient Provider, not valid."&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-5533236796363296618?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/5533236796363296618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=5533236796363296618' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5533236796363296618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5533236796363296618'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/11/making-entity-framework-work-with-web.html' title='Making Entity Framework work with a Web Application'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-5215450575207613124</id><published>2007-10-24T18:35:00.000+05:30</published><updated>2007-10-25T18:12:08.168+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Where'/><category scheme='http://www.blogger.com/atom/ns#' term='block of code in lambda expressions'/><category scheme='http://www.blogger.com/atom/ns#' term='control statements in lambda expessions'/><category scheme='http://www.blogger.com/atom/ns#' term='lambda expressions'/><category scheme='http://www.blogger.com/atom/ns#' term='dot net 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='expression trees'/><category scheme='http://www.blogger.com/atom/ns#' term='c# 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Select'/><category scheme='http://www.blogger.com/atom/ns#' term='anonymous methods'/><title type='text'>C# 3.0 Features: Lambda Expressions</title><content type='html'>C# 3.0 Lambda expressions come very handy to developers. One important consideration (which is beautiful) is that all these features (LINQ, C# 3.0 features, Entity Framework etc) come with no change in CLR. That means your old CLR, which executes your .Net 2.0 apps can execute your new apps too. And that implies that the IL that is emitted hasn't changed. So, though you use Lambda expressions instead of anonymous methods, the IL generated is the same in both cases. (Wow!!! Now I can feel the beauty of the IL concept and design.)&lt;br /&gt;&lt;br /&gt;Coming back to Lambda expressions, what are they basically? They are not just a syntactic substitute to anonymous methods. You can read more about Lambda expressions (and an interesting topic of how to pronounce them!!) in &lt;a href="http://blogs.msdn.com/ericwhite/pages/Lambda-Expressions.aspx"&gt;Eric White&lt;/a&gt;'s blog. I will deal with two important things of Lambda expressions (in context of LINQ) which you may not find often on the web.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Writing whole blocks of code in Lambda expressions. (Remember that Lambdas are expressions, hence writing more than one statement &lt;span style="font-style: italic;"&gt;may&lt;/span&gt; sound little odd)&lt;/li&gt;&lt;li&gt;Returning subtypes (or columns) of a type on which the LINQ query is fired.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Writing whole blocks&lt;/span&gt;&lt;br /&gt;Lambda expressions definitely make writing anonymous methods easy. Using Lambda you can do all that you can with anonymous and even more. So, if you can write a proper function with different control statements and logic using anonymous, you can do the same with lambda. Most of the lambda examples you see would be something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;var existingAccount = repository.Accout.Where(a =&gt; a.AccountId == "1");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can write quite an amount of logic here, something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;var existingAccount = repository.Accout.Where(a =&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                                                          if (a.AccountId == "1" &amp;amp;&amp;amp; a.AccountName == "Pavan")                                                                                                 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                                                                  return true;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                                                          else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                                                                  return false;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                                                                            });&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above code snippet will return an Account object after processing all the logic, accordingly. So, as you can see, it's just like any other (anonymous) function.&lt;br /&gt;&lt;br /&gt;Now, if you carefully observe the snippet above, we are returning a boolean value from within the lambda but what &lt;span style="font-style: italic;"&gt;existingAccount &lt;/span&gt;contains is an Account object. How did this happen? Well, it's pretty simple. If you carefully inspect signature of "Where" method being called on Account, you can understand.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_mR8Diuc11ls/RyCDBLJfMHI/AAAAAAAAAjU/xpCY9tzDPrQ/s1600-h/Where.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_mR8Diuc11ls/RyCDBLJfMHI/AAAAAAAAAjU/xpCY9tzDPrQ/s400/Where.jpg" alt="" id="BLOGGER_PHOTO_ID_5125240432143315058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;What &lt;span style="font-style: italic;"&gt;Where&lt;/span&gt; expects is a Linq.Expressions.Expression parameter which, in turn, expects a delegate that takes an input parameter as InsuranceDBWrapper.Account and returns a boolean. And this delegate's return value decides whether to return the object (in our case Account) on which &lt;span style="font-style: italic;"&gt;Where &lt;/span&gt;is being called. And that's exactly what our lambda does - to return a boolean telling whether to return the (Account) object or not. &lt;span style="font-style: italic;"&gt;Note that you can pass the delegate directly also without any expression in between. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Returning Subtypes (or columns)&lt;/span&gt;&lt;br /&gt;What if you don't want the whole type (or object) to be returned but just some columns or subtypes of it? You can as well do that, but not using Where. Where has 4 overloads of which two take expressions and the other two, directly delegates. But the sig for these delegates involves atmost two input parameters (first parameter is the type on which Where is applied and which is inferred automatically, second an int which gives the index of an item) and always returns a boolean (which tells whether to return the whole object or nothing). So, there is no means here to select and return specific columns. Since you return a boolean, it's either the complete object or nothing -  that is returned.&lt;br /&gt;&lt;br /&gt;What you need to use in this case is a &lt;span style="font-style: italic;"&gt;Select&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;var existingAccount = repository.Accout.Where(a =&gt; a.AccountId == "1")&lt;/span&gt;&lt;span style="font-style: italic;"&gt;.Select(b =&gt; new {b.AccountId, b.Name, b.IsLocked});&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This returns an anonymous type with three properties (AccountId, Name, IsLocked).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Select is used to filter on columns and Where is used to filter on rows.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lambdas can be used in Expression trees (which will be in a separate post :))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-5215450575207613124?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/5215450575207613124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=5215450575207613124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5215450575207613124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5215450575207613124'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/10/c-30-features-lambda-expressions.html' title='C# 3.0 Features: Lambda Expressions'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_mR8Diuc11ls/RyCDBLJfMHI/AAAAAAAAAjU/xpCY9tzDPrQ/s72-c/Where.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-1178631036747997273</id><published>2007-10-24T12:33:00.000+05:30</published><updated>2007-10-24T13:59:39.135+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='issue loading workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='can not find workflow instance'/><category scheme='http://www.blogger.com/atom/ns#' term='Workflow with id not found in persistance store'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='dot net 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='can not load workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='WF'/><title type='text'>Workflow with id not found in persistance store</title><content type='html'>For couple of days now I've been doing extensive debugging of a (Windows) Workflow. And time and again I've been facing this error. So I thought I will elaborate more on this. There are three primary reasons why this might happen:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Your workflow has actually terminated&lt;/span&gt;. It could have terminated or finished execution, but since you wouldn't try to load a finished workflow, in all probablities, it would have terminated (due to some unhandled exception). You can check this by going to your WorkflowInstance table in your persistence store and check the DbEndDateTime for your workflow instance. If it is null, then you can move to next points :-) else you have found the culprit. All you have gotta do is to debug into your workflow and fix your code.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Workflow changes&lt;/span&gt;. If you make any changes to your workflow and then try to load previous instances of it, you will see this error. You will have to apply the changes done on the workflow to the old instances also.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Try to connect to remote persistence store&lt;/span&gt;. If you are trying to load a workflow instance from a remote store, this error will come up. Make sure that your remote (store) server DTC is configured to allow this.&lt;/li&gt;&lt;/ol&gt;Hopefully, this will help people in saving time trying to find why the workflow doesn't load. Pls be aware that this error can come up due to many other reasons and not only the three mentioned above.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-1178631036747997273?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/1178631036747997273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=1178631036747997273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/1178631036747997273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/1178631036747997273'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/08/workflow-with-id-not-found-in.html' title='Workflow with id not found in persistance store'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-7818305875483169921</id><published>2007-10-24T11:36:00.000+05:30</published><updated>2007-10-24T12:16:15.377+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c# 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='var'/><category scheme='http://www.blogger.com/atom/ns#' term='the contextual keyword var may only appear within a local variable declaration'/><title type='text'>C# 3.0 Features: Var</title><content type='html'>"var" is one feature of C# 3.0 that has called for much debate. What is "var" and when can it be used, has already been dealt in many blogs and Microsoft documentation. So, I'll not be writing about it here. What I'll talk about is why var is not allowed to be passed around in functions i.e. why do you get this compile-time error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;the contextual keyword var may only appear within a local variable declaration&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;when you try to accept a parameter of type var. Considering that var can accept anonymous types, it is very convenient to tossing it around in function calls. But that isn't allowed. Let's see why:&lt;br /&gt;&lt;br /&gt;Let's approach this using the Contradiction theory.  Let's assume that this doesn't give any error and is allowed. Now, when the code is built the actual type of var has to be resolved. And since the var, in our case, hasn't been initialized (remember it's a function parameter), the compiler doesn't know to what type the var should be resolved. And that's why the compiler can't allow this. Let's also assume that the compiler is intelligent enough to infer its type from the invocation call of the method i.e.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;..........&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ExectueThis(5)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;..........&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;private void ExecuteThis(var intVar)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Looking at "ExectueThis(5)", let's say, the compiler infers &lt;span style="font-style: italic;"&gt;intVar&lt;/span&gt; is of Int32 type. Looks good to me if the compiler could do it. But what if ExecuteThis is called from somewhere else also and a string is being passed to it.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;ExecuteThis("abc")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Probably we can say that don't allow the second call as from the first call we have already determined &lt;span style="font-style: italic;"&gt;intVar &lt;/span&gt;to be Int32. But what if all this is in a class library, where you can't determine the sequence of function calls i.e we don't know whether first function call will be made first or the second one will be made first.&lt;br /&gt;&lt;br /&gt;So, essentially, there is no way the compiler can tell, for sure,  what type the var parameter is. And thus var can't be passed around in functions. I don't see a great use of var in general programming except if you are using LINQ. It helps you to avoid declaring custom types for each resultset that is returned from a LINQ query. var is more tailored for use with LINQ&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-7818305875483169921?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/7818305875483169921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=7818305875483169921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/7818305875483169921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/7818305875483169921'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/10/c-30-features-var.html' title='C# 3.0 Features: Var'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-6473354789248335506</id><published>2007-10-04T13:33:00.000+05:30</published><updated>2007-10-04T18:28:11.917+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='make sure the application for the project type (.csproj) is installed'/><category scheme='http://www.blogger.com/atom/ns#' term='the application for project is not installed'/><category scheme='http://www.blogger.com/atom/ns#' term='cannot open c# project in orcas beta 2'/><category scheme='http://www.blogger.com/atom/ns#' term='error opening c# project in orcas beta 2'/><title type='text'>VS 2005 C# projects in Orcas Beta 2</title><content type='html'>Opening a VS 2005 C# project (.csproj) in Orcas Beta 2 may sometimes throw you this error:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;"Make sure the application for the project type (.csproj) is installed."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;I tried googling on this but did not find much information except that, this might happen if your project is under source control. My projects were under source control and hence I was elated as the post did carry a solution for the same (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=8461&amp;amp;SiteID=1). But my elation was short-lived as the work-around didn't help me.&lt;br /&gt;&lt;br /&gt;After breaking my head for sometime I came with a work-around that resolved the issue. Here are the steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Delete the solution file and any associated source control bindings.&lt;/li&gt;&lt;li&gt;Open one of the projects (open the .csproj file)&lt;/li&gt;&lt;li&gt;Orcas will prompt for migration to new version. Finish it.&lt;/li&gt;&lt;li&gt;Now add all the remaining projects to the newly created solution.&lt;/li&gt;&lt;li&gt;Once you re-create your solution structure save it to the location from where you deleted the original one.&lt;/li&gt;&lt;/ol&gt;The solution can now be built.&lt;br /&gt;&lt;br /&gt;Also, do not forget to change the target framework to 3.5 in your project properties unless you aren't using any of 3.5 features.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-6473354789248335506?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/6473354789248335506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=6473354789248335506' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6473354789248335506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6473354789248335506'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/10/vs-2005-c-projects-in-orcas-beta-2.html' title='VS 2005 C# projects in Orcas Beta 2'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-7160890145346819366</id><published>2007-09-26T16:16:00.000+05:30</published><updated>2007-09-26T16:20:27.619+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='xlinq'/><category scheme='http://www.blogger.com/atom/ns#' term='introduction'/><category scheme='http://www.blogger.com/atom/ns#' term='entity framework'/><category scheme='http://www.blogger.com/atom/ns#' term='what is'/><category scheme='http://www.blogger.com/atom/ns#' term='dlinq'/><category scheme='http://www.blogger.com/atom/ns#' term='language integrated query'/><category scheme='http://www.blogger.com/atom/ns#' term='weblinq'/><category scheme='http://www.blogger.com/atom/ns#' term='basics'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='10 things'/><title type='text'>10 Things You Should Know About LINQ</title><content type='html'>&lt;div class="ms-PostBody"&gt;&lt;div dir=""&gt;&lt;div class="ExternalClassBDF90C786D424FDA9DD63DF946C10F90"&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;10 fundamental things that you should know about &lt;a href="http://msdn2.microsoft.com/hi-in/netframework/aa904594.aspx"&gt;LINQ&lt;/a&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;1.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ is &lt;b&gt;L&lt;/b&gt;anguage &lt;b&gt;IN&lt;/b&gt;tegrated &lt;b&gt;Q&lt;/b&gt;uery where the queries to data sources are written as part of the High Level .NET programming Language (like C# or VB.NET).&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;2.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;The queries, which are the language constructs, can be compiled using the language compilers. This ensures type-safety. The queries can also be debugged using the Visual Studio debugger (an awesome feature, I believe)&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;3.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;Intellisense can be used to access tables and their columns of a database. This feature is not present in the CTP versions but would be delivered with the Orcas release.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;4.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ provides Standard Query Operators (SQOs) (like select, union, where etc) to retrieve data from any object whose class implements the IEnumerable&lt;t&gt; interface. This is called "LINQ to Objects". The object, or rather data source, can be virtually anything: a registry collection or a File collection or a database.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;5.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ also provides SQOs to work with relational data, also called as "LINQ to ADO.NET or DLINK". It is comprised of three parts: “LINQ to SQL”; to query relational databases like SQL Server, “LINQ to DataSet”; supports queries using ADO.NET datasets and datatables and “LINQ to Entities”; to query ADO.NET 3.0 entities (Entities are part of Entity Framework of ADO.NET 3.0)&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;6.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ provides SQOs for XML documents, called "LINQ to XML or XLINK". It also provides a host of new XML-specific features for XML document creation and queries. It can be considered as a powerful replacement for DOM and XPath.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;7.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;WebLINQ, also known as BLINQ, creates CRUD ASP.NET pages (infact, a complete website) against a database using LINQ. It also preserves relationships between tables by providing an option on the aspx pages to view the related records from the related tables. I would suggest you to check this wonderful feature.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;8.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ not just supports simple queries but also stored procedures. &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;9.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ can be used to query on a join of different datasources. For example an RSS feed of a Blog, a collection object (like registry) and a bunch of rows from a database can all be joined together (using a SQO) and then be queried on. &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;span&gt;10.&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;LINQ maintains object identity. In other words, if two queries return the same information (say form a table), only one instance of that table “as an object” is maintained. This makes sure that objects are not created unnecessarily. This is a classic issue in ORM models, which is eliminated here.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; vertical-align: top; text-indent: -0.25in;"&gt;&lt;span style="font-size: 8.5pt; color: black; font-family: Verdana;"&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;With every release of a framework, life for developers is being made easier. With LINQ, so much code has been made simple to write and manage, that it cannot be put in less than a bible. I wonder if someday I would be jobless!&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Three cheers to LINQ!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;(Reproduced from my Infosys Blog)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-7160890145346819366?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/7160890145346819366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=7160890145346819366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/7160890145346819366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/7160890145346819366'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/09/10-things-you-should-know-about-linq.html' title='10 Things You Should Know About LINQ'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-4757093441436494674</id><published>2007-09-18T18:50:00.000+05:30</published><updated>2007-09-18T18:52:30.366+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SilverLight'/><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Suite'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend'/><title type='text'>Wealth of SilverLight Resources</title><content type='html'>&lt;div class="ExternalClass909616E5092E44BB8C155FE0A255F316"&gt; &lt;div&gt;There is a wealth of tutorials on SilverLight at &lt;/div&gt; &lt;div&gt;&lt;a href="http://groups.google.co.in/group/silverlightdiscussion/web/sliverlightlinks?hl=en"&gt;http://groups.google.co.in/group/silverlightdiscussion/web/sliverlightlinks?hl=en&lt;/a&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;Almost everything on SilverLight is covered; from SilverLight 1.0 to  SilverLight 1.1 to Expression  Blend. Also, there are some really good (links  to) tutorials from different websites.&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;Do check them out.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-4757093441436494674?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/4757093441436494674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=4757093441436494674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/4757093441436494674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/4757093441436494674'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/09/wealth-of-silverlight-resources.html' title='Wealth of SilverLight Resources'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-6000490610001701395</id><published>2007-08-10T18:03:00.000+05:30</published><updated>2007-08-10T18:19:49.210+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='cannot get values from grid view'/><category scheme='http://www.blogger.com/atom/ns#' term='hidden column issue'/><category scheme='http://www.blogger.com/atom/ns#' term='grid view'/><category scheme='http://www.blogger.com/atom/ns#' term='Can not retrieve values from grid view'/><category scheme='http://www.blogger.com/atom/ns#' term='primary key'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='null value from grid view'/><category scheme='http://www.blogger.com/atom/ns#' term='column'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='datatable'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Can not retrieve values from grid view</title><content type='html'>Working with grid view, I faced an issue!&lt;br /&gt;&lt;br /&gt;I had a gridview in which I had to hide few columns and use them later on for some conditional checks. The hiding part was quite easy and straight-forward but the conditional check was tricky. When I tried to get the values of the hidden column using&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic;"&gt;row.Cells[0].Text&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;where the hidden column index is 0, null was being returned. This looked strange to me as I was setting the values properly i.e. a datatable was being bound to the gridview and the datatable was properly constructed.&lt;br /&gt;&lt;br /&gt;It turned out that ability to retrieve values from hidden columns has been chopped off in the new gridview. The logic that I found out (after a bit of gooling) was that, since most of the users hide primary key columns in the datatable, it is not safe to allow the column values to be retrieved. I guess the first part of the logic is very much right, that primary key columns are the best prospects to hiding. The second part may also be correct, that it is unsafe to expose them. But these two parts together, cause more harm than good!&lt;br /&gt;&lt;br /&gt;First of all, inconvenience to devs as the regular functionality  is changed. Second, how are the devs expected to identify the rows that the user is operating on? Often, the data in the gridview has a mapping table and if the dev can't retrieve its primary key, what operations are possible on it? And what use is the grid off?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;Anyways, there is an easy workaround for this though. If you are in hurry, don't worry about all the blabber above. &lt;span style="font-weight: bold;"&gt;Just do the hiding of columns after you finish the binding of data&lt;/span&gt;. This works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-6000490610001701395?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/6000490610001701395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=6000490610001701395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6000490610001701395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6000490610001701395'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/08/can-not-retrieve-values-from-grid-view.html' title='Can not retrieve values from grid view'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-2275933112863459966</id><published>2007-07-16T16:33:00.000+05:30</published><updated>2007-08-09T19:34:53.624+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='service'/><category scheme='http://www.blogger.com/atom/ns#' term='obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='Pavan'/><category scheme='http://www.blogger.com/atom/ns#' term='Error loading workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='Runtime'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='not so obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kumar kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='WF'/><title type='text'>State-Machine Workflow Part II</title><content type='html'>We have the following on the host app:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A service class that implements &lt;span style="font-style: italic;"&gt;communication-service interface&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;The workflow runtime and its services which are instantiated and added respectively in the host app.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Service Class&lt;/span&gt;&lt;br /&gt;The service class basically implements the communication-service interface, promising the interface that it understands which events the workflow would support and that it will raise them. For each of the events that is supported the service class just raises them. That's it!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Workflow Runtime&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;We come to the centre of the pizza! Workflow runtime is the actual component that hosts the workflow. In effect, it's the translator between the workflow and the rest of the world.&lt;br /&gt;&lt;br /&gt;Many services can be registered while instantiating the runtime. Services for External Data Exchange, tracking etc (the list of services can be easily googled) are provided to add extra functionality to the bare-bone runtime. But it's very important to choose the services judiciously as a service without purpose brings down the performance.  &lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-2275933112863459966?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/2275933112863459966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=2275933112863459966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/2275933112863459966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/2275933112863459966'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/07/state-machine-workflow-part-ii.html' title='State-Machine Workflow Part II'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-5784062132266899285</id><published>2007-07-13T14:25:00.001+05:30</published><updated>2007-07-13T17:03:25.588+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='state-machine workflow'/><title type='text'>State-Machine Workflow Part I</title><content type='html'>&lt;span style="font-weight: bold;"&gt;State-machine Workflow&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_mR8Diuc11ls/Rpc-rYQKhLI/AAAAAAAAAfY/chJdtfEfAyM/s1600-h/StateMachineWorkflow.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_mR8Diuc11ls/Rpc-rYQKhLI/AAAAAAAAAfY/chJdtfEfAyM/s400/StateMachineWorkflow.JPG" alt="" id="BLOGGER_PHOTO_ID_5086603219103810738" border="0" /&gt;&lt;/a&gt;This dia helps me very nicely in understanding how to implement a state-machine workflow (which relies on external events). Let me see if I understand each of the components in the dia :)&lt;br /&gt;&lt;br /&gt;Let us start with the workflow part and then move to the host application part (prob in the next post if this one becomes too long):&lt;br /&gt;&lt;br /&gt;The workflow part has only a couple of things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The workflow itself, and&lt;br /&gt;&lt;/li&gt;&lt;li&gt;An interface&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;The Interface&lt;/span&gt;&lt;br /&gt;The interface, also sometimes called as &lt;span style="font-style: italic;"&gt;communication-service interface&lt;/span&gt;, is used to tell the outer world as to what events the workflow would respond to. To elaborate on this, the workflow is expected to handle events that are generated from the host application. Hence the host app needs to know which events the workflow is prepared to handle or, in other words, what functionality is the workflow capable of handling.  The same is exposed through a set of events. Essentially, it (the interface) is nothing more than a communication contract, which helps the host app to understand what events it can raise. The interface, at the minimum, is supposed to do two things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;Is marked with ExternalDataExchange attribute&lt;/span&gt;: This attribute tells the WF that this interface should be used as a contract. A simple example would be:&lt;/li&gt;&lt;/ul&gt;            &lt;span style="font-style: italic; color: rgb(0, 0, 153);"&gt;[ExternalDataExchange]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 153);"&gt;           public interface IAnalyzeNameService&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 153);"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 153);"&gt;                        event EventHandler&lt;analyzenameeventargs&gt; AnalyzeName;&lt;/analyzenameeventargs&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 153);"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Give a&lt;span style="color: rgb(204, 153, 51);"&gt; &lt;span style="color: rgb(255, 153, 0);"&gt;list of all the events&lt;/span&gt; &lt;/span&gt;that the workflow would respond to.&lt;/li&gt;&lt;/ul&gt;That's it on the interface end! Quite simple!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Workflow&lt;/span&gt;&lt;br /&gt;On the workflow end, in addition to the actual workflow that it would contain, it should also define the custom EventArgs that has been used while defining the event in the service interface. (One can consider this activity to be outside of workflow also. ) But there are few things that should be taken care of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;It should inherit from ExternalDataEventArgs&lt;/span&gt;: Unless this is done the custom event args is not accepted. The obvious reason is that this pre-defined type has some information, like the instaced id, that needs to be propogated to the WF infrastructure to raise the event on the appropriate workflow instance.&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;This class should be marked as serilizable&lt;/span&gt;: If this is not done, an EventDeliveryFailedException is thrown.&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;InstanceID of the workflow instance&lt;/span&gt; should be passed (in addition to any custom info that would be required to be passed), for reasons mentioned already.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;That does the job on the workflow side. There are a couple of things that should be done on the host app side and we are ready with a state-machine workflow running with the host app and the workflow communication in full flow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-5784062132266899285?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/5784062132266899285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=5784062132266899285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5784062132266899285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5784062132266899285'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/07/state-machine-workflow-this-dia-helps.html' title='State-Machine Workflow Part I'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_mR8Diuc11ls/Rpc-rYQKhLI/AAAAAAAAAfY/chJdtfEfAyM/s72-c/StateMachineWorkflow.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-2509224696893732840</id><published>2007-07-12T18:15:00.000+05:30</published><updated>2007-07-12T18:45:20.766+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pavan'/><category scheme='http://www.blogger.com/atom/ns#' term='Error loading workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kumar kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='Runtime capabilities are not available with this type'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='WF'/><title type='text'>Error loading workflow: Runtime capabilities are not available with this type</title><content type='html'>I just started-off with coding on workflows and the first error that I see:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_mR8Diuc11ls/RpYoB4QKhKI/AAAAAAAAAfQ/A-b1pHUZzcU/s1600-h/forblog.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_mR8Diuc11ls/RpYoB4QKhKI/AAAAAAAAAfQ/A-b1pHUZzcU/s400/forblog.JPG" alt="" id="BLOGGER_PHOTO_ID_5086296841906717858" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;I did quite a bit of googling but couldn't find any answer. Usually in these kind of errors, the error (written in blue) is given with link which would take the dev to the error line. But here the link doesn't work i.e. you don't go anywhere :)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;So the resolution?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Well, just rebuild the whole application. And it works like magic. Now, what's going on here: The scenario was that we were two guys working on same code using TFS. He had checked-in code which was not properly building (he was infact in the middle of making some changes). Once he checked-in properly building code things started working properly.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-2509224696893732840?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/2509224696893732840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=2509224696893732840' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/2509224696893732840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/2509224696893732840'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/07/error-loading-workflow-runtime.html' title='Error loading workflow: Runtime capabilities are not available with this type'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_mR8Diuc11ls/RpYoB4QKhKI/AAAAAAAAAfQ/A-b1pHUZzcU/s72-c/forblog.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-973038214101420269</id><published>2007-07-04T12:27:00.001+05:30</published><updated>2007-08-09T19:33:42.622+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pavan'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='not so obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kumar kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='pavan kulkarni'/><category scheme='http://www.blogger.com/atom/ns#' term='going forward'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='WF'/><title type='text'>Going Forward...</title><content type='html'>Long time that I've updated my blog. I was actually busy with a personal work and couldn't concentrate on this.&lt;br /&gt;&lt;br /&gt;Well, as Shakespeare said, All is well that ends well, I'm now going to resume my blog. But going forward the posts would be relating to Windows Workflow Foundation (WF), Windows Communication Foudnation (WCF) and Windows Presentation Foundation (WPF) rather than just C#. Though the theme of the posts would be same, "Not So Obvious..."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-973038214101420269?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/973038214101420269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=973038214101420269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/973038214101420269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/973038214101420269'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/07/going-forward.html' title='Going Forward...'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-9174597522207390579</id><published>2007-03-26T11:42:00.000+05:30</published><updated>2007-04-19T17:29:19.389+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='base type'/><category scheme='http://www.blogger.com/atom/ns#' term='dot net'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='not so obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='reference type'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><category scheme='http://www.blogger.com/atom/ns#' term='System.Object'/><category scheme='http://www.blogger.com/atom/ns#' term='System.ValueType'/><category scheme='http://www.blogger.com/atom/ns#' term='obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='type'/><category scheme='http://www.blogger.com/atom/ns#' term='value type'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='basics'/><category scheme='http://www.blogger.com/atom/ns#' term='C# basics'/><title type='text'>Every Type is derived from...</title><content type='html'>A simple question...&lt;br /&gt;&lt;br /&gt;Which is the type from which every other type is derived? Think before you look forward!&lt;br /&gt;If you are answer is System.Object, then it's partially correct. The actual answer is &lt;em&gt;&lt;span style="color:#3333ff;"&gt;System.Object&lt;/span&gt;&lt;/em&gt; if it's a &lt;em&gt;&lt;span style="color:#3333ff;"&gt;reference type&lt;/span&gt;&lt;/em&gt;. If it is a &lt;em&gt;&lt;span style="color:#009900;"&gt;value type&lt;/span&gt;&lt;/em&gt; then it derives from &lt;em&gt;&lt;span style="color:#009900;"&gt;System.ValueType.&lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-9174597522207390579?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/9174597522207390579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=9174597522207390579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/9174597522207390579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/9174597522207390579'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/03/every-type-is-derived-from.html' title='Every Type is derived from...'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-5662107874991245108</id><published>2007-03-24T15:45:00.001+05:30</published><updated>2007-03-26T11:41:25.353+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='dot net'/><category scheme='http://www.blogger.com/atom/ns#' term='entry point'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='multiple entry points'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><category scheme='http://www.blogger.com/atom/ns#' term='obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='program'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='main method'/><category scheme='http://www.blogger.com/atom/ns#' term='basics'/><category scheme='http://www.blogger.com/atom/ns#' term='compile'/><category scheme='http://www.blogger.com/atom/ns#' term='main'/><category scheme='http://www.blogger.com/atom/ns#' term='C# basics'/><title type='text'>Multiple Entry Points</title><content type='html'>A dot net program has a single point of entry (which is generally the Main function).&lt;br /&gt;&lt;em&gt;public static void Main(int args[])&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;A well-known fact:The execution of the program starts from here. If we look at the sig of the function we see that the Main function is publi. But ever wondered what happens if the sig is: &lt;em&gt;private static void Main(int args[]&lt;/em&gt;)?&lt;br /&gt;&lt;br /&gt;The Main method is invoked from outside of the program. So it is, obviously, essential that the method be public. But would the program compile if it was private? The answer is: YES. It would compile. For some reason, not so obvious to me, the compiler/runtime doesn't see difference between a public and a private Main method. All it needs is a Main method.&lt;br /&gt;&lt;br /&gt;So what if, in a program, we have two Main methods, either private or public or both? The compiler/runtime is confused. It doesn't know which is the actual point of entry. So, ambiguity! Hence, errors!&lt;br /&gt;&lt;br /&gt;But what if for some reason you want to have two main methods? Can you make things work or is it the end of the road? It's definitely not the end. You can still make it work, with as many Main methods you want. Only condition being, the fully qualified name of the method (or the type containing it) should be different from each of the other Main methods.&lt;br /&gt;&lt;em&gt;namespace MainNamespace&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;class FirstMain&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;public static void Main(int args[]) {}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;class SecondMain&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;public static void Main(int args[]) {}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;To build this program use:&lt;br /&gt;&lt;em&gt;csc.exe Program.cs&lt;/em&gt; /main:MainNamespace.FirstMain&lt;br /&gt;&lt;br /&gt;This will do the trick for you.&lt;br /&gt;The next obvious question is how would we compile it using VS 2005? I would take this in my next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-5662107874991245108?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/5662107874991245108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=5662107874991245108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5662107874991245108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5662107874991245108'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/03/multiple-entry-points.html' title='Multiple Entry Points'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-5973076160293033636</id><published>2007-03-23T11:18:00.000+05:30</published><updated>2007-03-23T16:26:59.901+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='multiple inheritence'/><category scheme='http://www.blogger.com/atom/ns#' term='program'/><category scheme='http://www.blogger.com/atom/ns#' term='dot net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='not so obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='mistake'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='compile'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><category scheme='http://www.blogger.com/atom/ns#' term='C# basics'/><title type='text'>Software and Writing - A Bad Combination!!</title><content type='html'>For many know that I work in software but few know that I'm into writing too. And since I'm into Dot Net Framework, this is actually a real bad combination, for reasons that I discovered only yesterday.&lt;br /&gt;&lt;br /&gt;Not that anything is wrong with software or writing. But both require me to be highly intellectual (of course, which I'm :-)). So my intellectuality is as follows:&lt;br /&gt;&lt;em&gt;class intellectuality&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;attention to detail; //for example&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now that I'm an intellectual, software and writing to me would be&lt;br /&gt;&lt;br /&gt;&lt;em&gt;class software : intellectuality&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class writing : intellectuality&lt;br /&gt;{&lt;br /&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;And I would become&lt;br /&gt;&lt;em&gt;class individual : software, writing&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;a clear example of multiple inheritence (Mind you! dot net framework doesn't allow this and "why" is what I'll try to address).&lt;br /&gt;&lt;br /&gt;Now, I have a software class and a writing class defining me. And each of these two classes are, in turn, defined by one intellectuality class each. When we create an instance of "individual" class, instances of "writing" and "software" are implicitly created. And since writing derives from "intellectuality" an instance of "intellectuality" is also created. Same happens for software also.  &lt;strong&gt;So, two intellectuality classes, one writing class and one software class define me.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Now where is all this (intellectuality) going to? Since all this, yet, doesn't make any sense, let's drill into it lil' more and see if this is of any use (otherwise you can always leave your brickbats in comments).&lt;br /&gt;&lt;br /&gt;First problem here is, though I'm an individual with ability to code and write and strong intellectual skills, I'm being represented by &lt;strong&gt;two &lt;/strong&gt;intellectual classes and not one. Mind you! I'm &lt;strong&gt;an intellect.&lt;/strong&gt; i.e. Since "individual" derives from "writing" and "software", it should essentially have 3 base classes (writing, software and intellectuality) but it has 4 base classes (writing, software and two intellectuality classes).&lt;br /&gt;&lt;br /&gt;Second, if I had to use my "attention to detail" ability from my "intellectuality", I do not know which one of the two intellectuality classes to make use of! Should I make use of intellectuality class of writing or of software? (personally I would prefer writing :-))  i.e. if we had to use a method or property of the base class "intellectuality" the runtime doesn't know from which instace to refer to (we have 2 instances created)!&lt;br /&gt;&lt;br /&gt;Third, let's say I want to fill in my "intellectuality" with abilities in my "individual". So, I do&lt;br /&gt;&lt;em&gt;intellectuality intellect = new individual();&lt;/em&gt;&lt;br /&gt;I'm essentially creating a base class as an instance of child class.&lt;br /&gt;We have problems here. As we have already seen, "individual" ends up having two "intellectuality" sub classes and hence the compiler doesn't know which "intellectuality" object I'm trying to refer to!&lt;br /&gt;&lt;br /&gt;These seem to be the "not so obvious" reasons for dot net framework banning Multiple Inheritence. This is also called as the "Diamond" problem. And as far as my life is concerned, it's far more simple and easier and, of course, devoid of "Diamond"(s)!!! :-) :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-5973076160293033636?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/5973076160293033636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=5973076160293033636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5973076160293033636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/5973076160293033636'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/03/software-and-writing-bad-combination.html' title='Software and Writing - A Bad Combination!!'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7478161890317222188.post-6641496278524993882</id><published>2007-03-22T15:34:00.000+05:30</published><updated>2007-03-22T16:39:30.772+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='dot net'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='mistake'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><category scheme='http://www.blogger.com/atom/ns#' term='obvious'/><category scheme='http://www.blogger.com/atom/ns#' term='program'/><category scheme='http://www.blogger.com/atom/ns#' term='c#.net'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='multiple declaration'/><category scheme='http://www.blogger.com/atom/ns#' term='basics'/><category scheme='http://www.blogger.com/atom/ns#' term='compile'/><category scheme='http://www.blogger.com/atom/ns#' term='C# basics'/><title type='text'>An Obvious Mistake</title><content type='html'>class MyClass&lt;br /&gt;{&lt;br /&gt;          private void Sample()&lt;br /&gt;                  {&lt;br /&gt;                             int i=10;&lt;br /&gt;                             int i=20;&lt;br /&gt;                  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Will this code compile?&lt;br /&gt;Obviously it wouldn't!!&lt;br /&gt;&lt;br /&gt;But why wouldn't it compile?&lt;br /&gt;Obviously because i has multiple declarations!!&lt;br /&gt;&lt;br /&gt;But what is not so obvious is the reason behind not allowing multiple declarations. To talk about those not so obvious reasons, first of all one basic point. What happens when you say int i=10?&lt;br /&gt;&lt;br /&gt;4 bytes of memory gets allocated, 10 is stored in it and the identifier 'i' points to it. Simple!&lt;br /&gt;&lt;br /&gt;Now let's say we do multiple declarations for i, like in the above program. int i=10 allocates 4 bytes of memory and i points to it. Then we have int i=20. Another 4 bytes is allocated, 20 stored in it and, again, identifier 'i' points to this new memory. So when you use 'i' again anywhere, the compiler or runtime doesn't know which chunk of memory you are trying to reference to! Hence, undesired results!&lt;br /&gt;&lt;br /&gt;This is the not so obvious reason for the program not compiling!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7478161890317222188-6641496278524993882?l=pavkul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pavkul.blogspot.com/feeds/6641496278524993882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7478161890317222188&amp;postID=6641496278524993882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6641496278524993882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7478161890317222188/posts/default/6641496278524993882'/><link rel='alternate' type='text/html' href='http://pavkul.blogspot.com/2007/03/obvious-mistake.html' title='An Obvious Mistake'/><author><name>Pavan Kulkarni</name><uri>http://www.blogger.com/profile/14857934082429439409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://img176.imageshack.us/img176/6360/img0382rk3.th.jpg'/></author><thr:total>0</thr:total></entry></feed>
