<?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-8991933975193945258</id><updated>2012-01-19T15:45:16.994-02:00</updated><category term='Virtualization Technology'/><category term='Blob Storage'/><category term='Crystal Reports'/><category term='LINQ'/><category term='Windows Forms'/><category term='Windows 2003'/><category term='Visual Studio'/><category term='Virtual PC'/><category term='Performance'/><category term='REST'/><category term='TFS'/><category term='SQL Server'/><category term='SharePoint'/><category term='Expression Blend'/><category term='Windows Virtual PC'/><category term='.NET Framework'/><category term='SharePoint 2010'/><category term='Security'/><category term='MSBuild'/><category term='SharePoint Branding'/><category term='SCC'/><category term='AdventureWorks'/><category term='IIS'/><category term='Error Handling'/><category term='Azure'/><category term='ASP.NET'/><category term='Test Machine Setup'/><category term='Virtual Server'/><category term='Reporting'/><category term='Microsoft.SharePoint'/><category term='DevTableGen'/><category term='Table Storage'/><category term='Content Deployment'/><category term='Windows 2008'/><category term='WPF'/><category term='Hyper-V Server'/><category term='Development Storage'/><category term='Entity Framework'/><category term='Windows 7'/><title type='text'>GBLog</title><subtitle type='html'>My (b)log of technical stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-3440492458248903838</id><published>2012-01-19T15:45:00.000-02:00</published><updated>2012-01-19T15:45:17.002-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blob Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><title type='text'>CloudBlob, OpenRead and DowloadToStream: To Read or Not To Read</title><content type='html'>&lt;div&gt;So there we are trying to access a bunch of XML files, stored as a ZIP on an Azure Blob. &lt;b&gt;CloudBlob&lt;/b&gt; has an &lt;b&gt;OpenRead()&lt;/b&gt; method that returns a stream, which I can feed to the &lt;b&gt;ZipInputStream&lt;/b&gt; class in the &lt;a href="http://dotnetzip.codeplex.com/"&gt;DotNetZip library&lt;/a&gt; (a good, easy to use and free zip manipulation library). Local tests against the Compute and Storage emulators go smooth. When we deploy to the cloud, the app seems to hang. But we find out that its not hung; after some time reading the zip file, the read operations slow down from 20 files per second to 1 (&lt;i&gt;one&lt;/i&gt;) file each 30 (&lt;i&gt;thirty&lt;/i&gt;) seconds. Took us a hole day to pin down the problem to the reading operations on the Azure Blob. There's another method to get a stream from a Blob: &lt;b&gt;CloudBlob.DownloadToStream()&lt;/b&gt;. We changed the code from&lt;br /&gt;&lt;pre class="codigo"&gt;Stream OpenZipFromBlob(...)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CloudBlob blob = ...;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return blob.OpenStream();&lt;br /&gt;}&lt;/pre&gt;to&lt;br /&gt;&lt;pre class="codigo"&gt;Stream OpenZipFromBlob(...)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CloudBlob blob = ...;&lt;br /&gt;&amp;nbsp; &amp;nbsp; MemoryStream ms = new MemoryStream(); // do NOT use constructors that takes a byte array -&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;// they will generate a "MemoryStream is not expandable".&lt;br /&gt;&amp;nbsp; &amp;nbsp; blob.DownloadToStream(ms);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ms;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;and everything went back to normal. I could not find any difference between &lt;b&gt;OpenRead()&lt;/b&gt; and &lt;b&gt;DownloadToStream()&lt;/b&gt; that justifies this behavior.&amp;nbsp;Anyway, if you are having performance problems with &lt;b&gt;OpenRead()&lt;/b&gt;, try methods&amp;nbsp;&lt;b&gt;DownloadToStream()|File()&lt;/b&gt; to see if they can work around the problem.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" src="https://public.blu.livefilestore.com/y1pWK99koH6YgVsmjoea3b29U43gA6QeTwFqVBNzEh3p3rGtO8Aj3z1YP-m2Bm_5MK2a8DHHfSx70IPW11jvj1mMg/2012-01-18_17-19-07_675.jpg?psid=1" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;CloudBlob left some resentment on our team&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;GB&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-3440492458248903838?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/3440492458248903838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2012/01/cloudblob-openread-and-dowloadtostream.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3440492458248903838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3440492458248903838'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2012/01/cloudblob-openread-and-dowloadtostream.html' title='CloudBlob, OpenRead and DowloadToStream: To Read or Not To Read'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-2952193621782954960</id><published>2011-12-23T11:21:00.001-02:00</published><updated>2011-12-23T11:21:40.925-02:00</updated><title type='text'>Queue names restrictions on Azure Storage</title><content type='html'>&lt;p&gt;We got the exception “&lt;em&gt;One of the request inputs is out of range&lt;/em&gt;” using a queue to link web and worker roles on Azure. Of course my little prof-of-concept test with code copy-and-pasted from the Azure Tranning Kit ran ok, but the (almost) same code on my app did not. After some time I noticed that the exception was generated when I used upper-case letters on the queue name. Well, the rules for naming queues on Azure are &lt;a href="http://msdn.microsoft.com/en-us/library/dd179349.aspx"&gt;here&lt;/a&gt;, but basically they are:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Names can be made of letters, digits and the dash char (-).&lt;/li&gt;    &lt;li&gt;First and last chars must be letters ou digits. Consecutive dashes are not allowed.&lt;/li&gt;    &lt;li&gt;&lt;em&gt;All letters must be lower case&lt;/em&gt;. (Come on, man. You have this kind of restriction and it’s not documented on the API help? Put it in the &lt;a href="http://msdn.microsoft.com/en-us/library/gg436013.aspx"&gt;CloudQueueClient constructor&lt;/a&gt;, or in &lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k(MICROSOFT.WINDOWSAZURE.STORAGECLIENT.CLOUDQUEUECLIENT.GETQUEUEREFERENCE);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22);k(DevLang-CSHARP)&amp;amp;rd=true"&gt;CloudQueueClient.GetQueueReference()&lt;/a&gt;, which receives the name of the queue, or at least in &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.cloudqueue.createifnotexist.aspx"&gt;CloudQueue.CreateIfNotExists()&lt;/a&gt;, since this method creates the queue… :-P)&lt;/li&gt;    &lt;li&gt;The queue name length must be between 3 and 63 chars.&lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-2952193621782954960?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/2952193621782954960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2011/12/queue-names-restrictions-on-azure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/2952193621782954960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/2952193621782954960'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2011/12/queue-names-restrictions-on-azure.html' title='Queue names restrictions on Azure Storage'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-3220088535857870027</id><published>2011-07-20T14:47:00.001-03:00</published><updated>2011-07-20T14:47:51.005-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ReportViewer: Another Reason to “Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[..]”</title><content type='html'>&lt;p&gt;If you are stuck with a blank screen when using the ReportViewer control that ships with Visual Studio 2010, check if you provided values for all the parameters in the report. We created a report using {CTRL+C CTRL+V} on an existing report, and the second report used only 3 of the 4 parameters on the original report. We did not provide any value to the last parameter, and it had no default value configured, so the ReportViewer rendered a blank panel on the web form, and generated the following JavaScript error: &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[1] &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When we edited the report's RDLC file (I could not find the &amp;quot;Report Parameters&amp;quot; menu option that should be under the “Report” menu in Visual Studio, so I opened the RDLC file using Visual Studio XML Editor), and took off the unused parameter defition, the ReportViewer rendered ok. Thanks to &lt;a href="http://www.networksteve.com/enterprise/topic.php/ssrs_2008_R2_-_report_parameter_with_no_default_set_throws_java/?TopicId=10227&amp;amp;Posts=1"&gt;this post&lt;/a&gt; for pointing me to the right direction.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-3220088535857870027?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/3220088535857870027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2011/07/reportviewer-another-reason-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3220088535857870027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3220088535857870027'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2011/07/reportviewer-another-reason-to.html' title='ReportViewer: Another Reason to “Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[..]”'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-195229923503957615</id><published>2010-10-13T21:21:00.001-03:00</published><updated>2011-02-14T10:08:07.809-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error Handling'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='Development Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='Table Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Azure Tables Error Messages</title><content type='html'>&lt;p&gt;Azure Table Storage (ATS) is a REST-basead data access mechanism, and REST is based on HTTP. So, makes sense that ATS data access errors are returned as HTTP errors. But some &lt;em&gt;translation&lt;/em&gt; is needed to understand those errors.&lt;/p&gt;  &lt;p&gt;1. &lt;strong&gt;DataServiceRequestException&lt;/strong&gt; and &lt;strong&gt;DataServiceClientException&lt;/strong&gt; exceptions&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;When a data access error occurs in ATS, the exception returned usually is from &lt;strong&gt;DataServiceRequestException&lt;/strong&gt; class, being the error message “&lt;em&gt;An error ocurred while processing this request&lt;/em&gt;”. This exception encapsulates a more specific &lt;strong&gt;DataServiceClientException&lt;/strong&gt; exception, that contains a XML document on the &lt;strong&gt;Message&lt;/strong&gt; property describing the error:&lt;/p&gt;    &lt;div style="border-bottom: black 1px solid; border-left: black 1px solid; font: 10pt &amp;#39;Courier New&amp;#39;, courier, fixed; word-wrap: normal; white-space: nowrap; overflow: scroll; border-top: black 1px solid; border-right: black 1px solid"&gt;     &lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;error xmlns=&amp;quot;&lt;a href="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&amp;quot;"&gt;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&amp;quot;&lt;/a&gt;&amp;gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#ff0000"&gt;&amp;lt;code&amp;gt;&lt;strong&gt;EntityAlreadyExists&lt;/strong&gt;&amp;lt;/code&amp;gt;&lt;/font&gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;message xml:lang=&amp;quot;pt-BR&amp;quot;&amp;gt;The specified entity already exists.&amp;lt;/message&amp;gt;         &lt;br /&gt;&amp;lt;/error&amp;gt;&lt;/p&gt;   &lt;/div&gt;    &lt;p&gt;The value on the &lt;strong&gt;&amp;lt;code&amp;gt;&lt;/strong&gt; element needs to be interpreted considering what the application was doing when the error ocurred. For example, the code &lt;strong&gt;InvalidInput&lt;/strong&gt; is generated if you are trying to save an entity that has a property of an unsupported data type; OR if you are trying to update an entity that has no concurrency control information. Almost the same, right? ;-)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;2. Error codes an possible causes&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Following are the HTTP error code that we’ve bumped into, and what the application was trying do do when the error ocurred.&lt;/p&gt;    &lt;table border="1" cellspacing="0" cellpadding="2" width="633"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="203"&gt;&lt;strong&gt;&lt;font size="2"&gt;Error Code                &lt;br /&gt;(value on &amp;lt;code&amp;gt; element)&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="428"&gt;&lt;strong&gt;&lt;font size="2"&gt;Possible Causes&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="205"&gt;&lt;strong&gt;&lt;font size="2"&gt;ConditionNotMet&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="426"&gt;&lt;font size="2"&gt;- Concurrency error. The app read some entity; when trying to modify or delete the entity, it had already been modified by a command from another data context.&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="207"&gt;&lt;strong&gt;&lt;font size="2"&gt;EntityAlreadyExists&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="425"&gt;&lt;font size="2"&gt;- Primary key violation. The app is trying to insert an entity, but there’s an entity on the table with the same values for &lt;strong&gt;PartitionKey &lt;/strong&gt;and &lt;strong&gt;RowKey &lt;/strong&gt;properties on the entity being inserted.&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="208"&gt;&lt;strong&gt;&lt;font size="2"&gt;InternalError&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;&lt;font size="2"&gt;- Use of unsupported Linq operators on ATS. (We found this one trying to recover rows that had a string property starting with some value. There’s no string support for &lt;strong&gt;like&lt;/strong&gt;, &lt;strong&gt;&amp;gt;&lt;/strong&gt;, &lt;strong&gt;&amp;lt;&lt;/strong&gt;, and neither &lt;strong&gt;string.StartsWith()&lt;/strong&gt; – the one that generated the error. You have to use &lt;strong&gt;string.CompareTo()&lt;/strong&gt; – :-P)&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="209"&gt;&lt;strong&gt;&lt;font size="2"&gt;InvalidInput&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;&lt;font size="2"&gt;- Storing an entity that has properties of &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd179338.aspx"&gt;&lt;font size="2"&gt;types not supported by ATS&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.              &lt;br /&gt;- Updating an entity that was attached to the context (&lt;strong&gt;TableServiceContext.AttachTo()&lt;/strong&gt;), but has null on it’s &lt;/font&gt;&lt;a href="http://en.wikipedia.org/wiki/HTTP_ETag"&gt;&lt;font size="2"&gt;ETag&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; property.              &lt;br /&gt;- Linq queries on a table with no structure defined. We received this error when trying to query a table that had just been created; if you insert some entities, even if you erase all the entities on table later, it seems that the table holds the entity structure and you can use it on Linq queries.               &lt;br /&gt;- Linq queries using &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397696.aspx"&gt;&lt;font size="2"&gt;anonymous types&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. The workaround was to make the query return the “whole” entity, and build a second query using anonmymous types on the data returned by ATS.             &lt;br /&gt;- Batch save operation (&lt;strong&gt;SaveChanges(SaveOptions.Batch)&lt;/strong&gt;) with 2 or more entities having the same Partion and Row Keys.&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="209"&gt;&lt;strong&gt;&lt;font size="2"&gt;ResourceNotFound&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;&lt;font size="2"&gt;- Linq query &lt;font size="2"&gt;that returns no entitites&lt;/font&gt; using equality conditions on PartitionKey and RowKey (&lt;em&gt;where entity.PartitionKey == “…” &amp;amp;&amp;amp; entity.RowKey == “…”&lt;/em&gt;). (Queries with conditions using other attributes return a 0-sized list)               &lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;- Concurrency error. The app read some entity; when trying to modify or delete the entity, it had already been deleted by a command from another data context.              &lt;br /&gt;- Linq query on a table that does not exist on ATS.&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="209"&gt;&lt;strong&gt;TableAlreadyExists&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;Found on calls to &lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k(MICROSOFT.WINDOWSAZURE.STORAGECLIENT.CLOUDTABLECLIENT.CREATETABLESFROMMODEL);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22);k(DevLang-CSHARP)&amp;amp;rd=true"&gt;&lt;strong&gt;CloudTableClient.CreateTablesFromModel()&lt;/strong&gt;&lt;/a&gt;. It seems that concurrent calls to this method may end up generating this exception. We placed a call to &lt;strong&gt;CreateTablesFromModel()&lt;/strong&gt; on the data access context static constructor. When we raised the number of role instances to 2, one of them started ok, and the other one generated the exception.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="209"&gt;&lt;strong&gt;TableBeingDeleted&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;Same as &lt;strong&gt;TableAlreadyExists&lt;/strong&gt; above.&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="209"&gt;&lt;strong&gt;OutOfRangeInput&lt;/strong&gt;&lt;/td&gt;          &lt;td valign="top" width="424"&gt;Generated when saving an entity with an uninitialized DateTime property. &lt;a href="http://msdn.microsoft.com/en-us/library/dd179338.aspx"&gt;The minimum allowed value for a DateTime property on ATS is Jan 01, 1601&lt;/a&gt;, and an uninitialized DateTime in C# holds Jan 01, year 1. We didn’t detected it on tests against DevStorage because &lt;a href="http://msdn.microsoft.com/en-us/library/dd320275.aspx"&gt;it changes dates before Jan 01, 1753 to Jan 01, 1753, but ATS does not&lt;/a&gt;.&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/blockquote&gt;  &lt;p&gt;3. How to extract the HTTP error code from &lt;strong&gt;DataServiceClientException&lt;/strong&gt; objects&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The code is based on an &lt;strong&gt;enum&lt;/strong&gt; that has members named &lt;u&gt;exactly&lt;/u&gt; as the error codes returned by ATS:&lt;/p&gt;    &lt;div style="border-bottom: black 1px solid; border-left: black 1px solid; font: 10pt &amp;#39;Courier New&amp;#39;, courier, fixed; word-wrap: normal; white-space: nowrap; overflow: scroll; border-top: black 1px solid; border-right: black 1px solid"&gt;     &lt;br /&gt;public enum ATSError       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; EntityAlreadyExists,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ConditionNotMet,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; InvalidInput,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ResourceNotFound,&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Unknown&amp;#160; // This one is the &amp;quot;generic&amp;quot; error code&amp;#160; &lt;br /&gt;} &lt;/div&gt;    &lt;p&gt;The following method extracts the error code from the XML returned by ATS, and converts it on the correspondent &lt;strong&gt;ATSError&lt;/strong&gt; enum value:&lt;/p&gt;    &lt;div style="border-bottom: black 1px solid; border-left: black 1px solid; font: 10pt &amp;#39;Courier New&amp;#39;, courier, fixed; word-wrap: normal; white-space: nowrap; overflow: scroll; border-top: black 1px solid; border-right: black 1px solid"&gt;     &lt;p&gt;/// &amp;lt;summary&amp;gt;        &lt;br /&gt;/// Translates an ATS exception to one of the ATSErrors values.         &lt;br /&gt;/// &amp;lt;/summary&amp;gt;         &lt;br /&gt;/// &amp;lt;param name=&amp;quot;error&amp;quot;&amp;gt;Exception returned by ATS.&amp;lt;/param&amp;gt;         &lt;br /&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;         &lt;br /&gt;public static ATSError ExtractATSError(Exception e)         &lt;br /&gt;{         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // Searches for a DataServiceClientException exception         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; while (!(e is System.Data.Services.Client.DataServiceClientException) &amp;amp;&amp;amp; (e != null))&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e = e.InnerException;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (e == null) return ATSError.Unknown; &lt;/p&gt;      &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; // At this point &amp;quot;e&amp;quot; contains a DataServiceClientException object,&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // and the Message property contains a valid XML document describing the error         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ATSError code;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; try         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XmlDocument xml = new XmlDocument();         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xml.LoadXml(e.Message);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // The XML document uses namespace http://schemas.microsoft.com/ado/2007/08/dataservices/metadata, so&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // we have to use a XmlNamespaceManager to represent this namespace         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XmlNamespaceManager namespaceManager = new XmlNamespaceManager(xml.NameTable);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; namespaceManager.AddNamespace(&amp;quot;n&amp;quot;, &amp;quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&amp;quot;);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Retrieves the &amp;quot;&amp;lt;code&amp;gt;&amp;quot; element&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string s = xml.SelectSingleNode(&amp;quot;/n:error/n:code&amp;quot;, namespaceManager).InnerText;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Converts the element value to the corresponding ATSError value         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; code = (ATSError)Enum.Parse(typeof(ATSError), s);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; catch         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; code = ATSError.Unknown;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return code;         &lt;br /&gt;}&lt;/p&gt;   &lt;/div&gt;    &lt;p&gt;And that’s it. If you bump into another error code, just add the corresponding member on the &lt;strong&gt;ATSError&lt;/strong&gt; enum, so that the &lt;strong&gt;ExtractATSError()&lt;/strong&gt; method will recognize it.&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-195229923503957615?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/195229923503957615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/10/azure-tables-error-messages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/195229923503957615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/195229923503957615'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/10/azure-tables-error-messages.html' title='Azure Tables Error Messages'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-256302022075498568</id><published>2010-08-24T14:33:00.000-03:00</published><updated>2010-08-24T14:33:43.468-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><title type='text'>Error on Azure Development Storage startup</title><content type='html'>Right after you install Azure Tools for Visual Studio, if you try to start the Development Storage service, a command prompt window pops up, then shows a error message in red, then closes so fast you can't even start to read the error message. I've tried to start the Development Storage from a command prompt to see what was the error. But the .lnk file to Dev Storage does not show what is the command to start it.&lt;br /&gt;&lt;blockquote&gt;Tip 1: To start Azure Development&amp;nbsp;Storage from a command prompt, open an Azure Command Prompt (&lt;strong&gt;Start &amp;gt; All Programs &amp;gt; Windows Azure SDK &amp;gt; Windows Azure SDK Command Prompt&lt;/strong&gt;), and then run&amp;nbsp;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;strong&gt;csrun /devstore&lt;/strong&gt;&lt;/span&gt;.&lt;/blockquote&gt;Ok. Then I could see the error message:&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;Encountered an unexpected error from the devstore: Unable to start Development Storage.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Error Details: Failed to start Development Storage: the SQL Server instance 'localhost\SQLExpress' could not be found. Please configure the SQL Server instance for Development Storage using the 'DSInit' utility in the Windows Azure SDK.&lt;/strong&gt;&lt;/blockquote&gt;Nothing like being able to read the error message when you're trying to fix&amp;nbsp;some error.&amp;nbsp;That leads to&lt;br /&gt;&lt;blockquote&gt;Tip 2: After you install Azure Tools for Visual Studio, run &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;strong&gt;dsinit /sqlinstance:sql_instance_name&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;to create the database needed to run Development Storage.&lt;/blockquote&gt;Since I already have a non-named default SQL Server instance, I ran &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;strong&gt;dsinit /sqlinstance:.&lt;/strong&gt;&lt;/span&gt; (dsinit /sqlinstance "colon" "dot"), as "dot" is the name for a default SQL Server instance. Then Dev Storage started up ok.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-256302022075498568?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/256302022075498568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/08/error-on-azure-development-storage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/256302022075498568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/256302022075498568'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/08/error-on-azure-development-storage.html' title='Error on Azure Development Storage startup'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-4011877164150881105</id><published>2010-06-17T23:03:00.004-03:00</published><updated>2010-10-08T16:33:13.676-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Test Machine Setup'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>Test machine using boot from VHD</title><content type='html'>Another option to my last post on SharePoint test machine setup is to &lt;em&gt;boot from a VHD file&lt;/em&gt;. A VHD is a Virtual Hard Disk, a file that is used as a hard disk on a Virtual PC or Hyper-V Virtual Machine.&lt;br /&gt;&lt;br /&gt;I followed &lt;a href="http://blog.frankovic.net/2009/05/boot-win-2008-r2-rc-from-vhd/"&gt;the instructions on Marin Frankovic's blog about it&lt;/a&gt;, and it was very easy to create an easy-to-rollback, boot-from-vhd test environment. That's what I did:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I used Marin's post to install a fresh Windows 2008 boot.&lt;/li&gt;&lt;li&gt;I then created a differencing vhd based on the new W2K8 boot, using &lt;strong&gt;diskpart&lt;/strong&gt; and running the diskpart command &lt;strong&gt;create vdisk file=c:\testdiff.vhd parent=c:\test.vhd maximum=size_in_mb type=expandable &lt;/strong&gt;(or &lt;strong&gt;fixed&lt;/strong&gt;). This is nice because you can create a initial differencing VHD from a base VHD, put aside a copy of this differencing VHD, and "destroy" your new boot with tests. When you want to rollback the "destruction", just throw away the differencig file your were using, and start with a fresh new copy from the VHD you put aside before.&lt;/li&gt;&lt;li&gt;Next I added the boot entry to this differencing vhd. On a command prompt:&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;a. &lt;strong&gt;bcdedit /copy&lt;/strong&gt; generates boot entry copies. There's plenty of references on this, google for some.&lt;br /&gt;b. Run the following to point the new boot entry to the differencing VHD:&lt;br /&gt;&lt;strong&gt;bcdedit /set {boot_identifier} device vhd=[c:]\path_to_vhd\vdhfile.vdh&lt;br /&gt;bcdedit /set {boot_identifier} osdevice vhd=[c:]\path_to_vhd\vhdfile.vhd&lt;br /&gt;bcdedit /set {boot_identifier} detecthal yes&lt;/strong&gt;(the boot identifier is shown when you generate the boot copy with &lt;strong&gt;bcdedit /copy&lt;/strong&gt;. It can also be seen f you run &lt;strong&gt;bcdedit &lt;/strong&gt;with no params)&lt;/li&gt;&lt;/ol&gt;And that's it. Your tests boots now can use the full power of your machine, RAM &amp;amp; CPU, instead of sharing the (precious) hardware with the host OS, as VM's do. Just remember: boot from VHD is supported only if your OS is W7 Ultimate or Enterprise, or W2K8 R2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-4011877164150881105?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/4011877164150881105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/06/test-machine-using-boot-from-vhd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4011877164150881105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4011877164150881105'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/06/test-machine-using-boot-from-vhd.html' title='Test machine using boot from VHD'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-8082140072690395627</id><published>2010-03-25T08:40:00.010-03:00</published><updated>2010-10-08T16:38:41.610-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hyper-V Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Test Machine Setup'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2010'/><title type='text'>SharePoint 2010 Test Machine Setup</title><content type='html'>Some facts on my SharePoint 2010 test environment setup:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 130%;"&gt;&lt;strong&gt;&lt;em&gt;1. Some useful links&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SharePoint Server 2010 Beta&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx"&gt;http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx&lt;/a&gt;&lt;br /&gt;SharePoint Server 2010 setup. SharePoint "Server" edition corresponds to MOSS 2007 (the "full" version). SharePoint Foundation 2010 is the new WSS 3 (the "free" version).&lt;/li&gt;&lt;li&gt;2010 Information Worker Demonstration Virtual Machine (Beta)&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&lt;/a&gt;&lt;br /&gt;Its a VHD (a Virtual Had Disk on Virtual PC/Virtual Server/Hyper-V format) with a complete test environment for SharePoint 2010.&lt;/li&gt;&lt;li&gt;Microsoft SharePoint Designer 2010 Beta&lt;br /&gt;64 bits: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=eeda9ab1-ac53-4870-9e1c-38940343d677&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=eeda9ab1-ac53-4870-9e1c-38940343d677&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;32 bits: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=82df15bd-16a5-460e-a7c4-22599c669bb1&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=82df15bd-16a5-460e-a7c4-22599c669bb1&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;SP Designer Beta (authoring tool for SharePoint)&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size: 130%;"&gt;2. The SharePoint Demonstration Virtual Machine&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It's a complete test environment for SharePoint 2010, comes pre-loaded with SharePoint Server 2010, Office 2010, SharePoint Designer 2010, an Active Directory domain, Visual Studio 2010, SQL Server 2008 + Analysis &amp;amp; Reporting Services, Exchange Server 2010 (Exchange on a second VM), and several sample sites with data on it. It saves &lt;strong&gt;a lot&lt;/strong&gt; of work.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SharePoint 2010 is a *64-bit only* software&lt;/strong&gt;, so you can't create its VM's on Virtual Server or Virtual PC, since they don't support 64-bits VM's. &lt;ul&gt;&lt;li&gt;Since the VM guest operationg system has to be 64-bit, you will have to user Hyper-V, wich only runs on Windows 2008 machines.&lt;/li&gt;&lt;li&gt;If you have a desktop that has been more off than on since you got that notebook you are using now, a "lighter" option is to download (free) and intall &lt;a href="http://technet.microsoft.com/en-us/evalcenter/dd776191.aspx"&gt;Hyper-V Server 2008 R2&lt;/a&gt;. It's a stripped down version of Windows 2008 designed solely to run VM's and with support for remote VM management (so you will work from the new note ;-). My 3GHz Pentium &lt;em&gt;D&lt;/em&gt; (yes, Dual Core, not Core2 Duo) with 6GB RAM could handle the SharePoint 2010 VM reasonably.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;Aside from that, you do can &lt;a href="http://msdn.microsoft.com/en-us/library/ee554869%28office.14%29.aspx"&gt;install SharePoint 2010 Beta on Windows 7 and Vista&lt;/a&gt; (provided that they are 64-bit installations), but it seems too much trouble just for setup a test machine. If you have a Windows 2008 machine, create the VM on Hyper-V, attach the VHD, and that´s it. If not and you have a second machine at hand, go for Hyper-V Server. It took far more time for me to download the Hyper-V Server setup than to get the SharePoint VM running, so that's my suggestion for you.&lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span style="color: #333333; font-size: 100%;"&gt;&lt;strong&gt;Note: the only thing I had to change on MS SharePoint Demonstration VM was to fix the virtual network adapter IP address to 192.168.150.1, wich is the address the DNS entries are setup to. and that's it. &lt;em&gt;That&lt;/em&gt; took some time to figure out, but not that much... ;-)&lt;/strong&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span style="color: #333333; font-size: 100%;"&gt;&lt;strong&gt;Note2: Check out this post too: "&lt;a href="http://gbuchoa2.blogspot.com/2010/06/test-machine-using-boot-from-vhd.html"&gt;Test Machine Using Boot From VHD&lt;/a&gt;". Booting from a VHD improves the performance of your test machine, because there's only &lt;em&gt;one&lt;/em&gt; operating system running - instead of two, as when you use virtual machines.&lt;/strong&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-8082140072690395627?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/8082140072690395627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/03/sharepoint-2010-test-machine-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/8082140072690395627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/8082140072690395627'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/03/sharepoint-2010-test-machine-setup.html' title='SharePoint 2010 Test Machine Setup'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-8482076689208969112</id><published>2010-02-26T15:33:00.002-03:00</published><updated>2010-02-26T15:41:43.293-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Branding'/><title type='text'>SharePoint: The site theme is not applied to my custom page</title><content type='html'>If you created and/or customized pages in a SharePoint 2007 site, and when changing the site theme this change does not appears on the customized pages, one possible cause is the absence of the ASP.NET server tag that includes site themes on the page. Try placing the following markup on the &lt;strong&gt;&amp;lt;head&amp;gt;&lt;/strong&gt; session of the page:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;SharePoint:Theme runat="server"&amp;gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This server control writes the &lt;b&gt;&amp;lt;link&amp;gt;&lt;/b&gt; tag that includes the selected theme CSS styles on the generated HTML.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-8482076689208969112?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/8482076689208969112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/02/sharepoint-site-theme-is-not-applied-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/8482076689208969112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/8482076689208969112'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/02/sharepoint-site-theme-is-not-applied-to.html' title='SharePoint: The site theme is not applied to my custom page'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-737406438897825464</id><published>2010-02-02T15:01:00.005-02:00</published><updated>2010-02-02T22:56:46.449-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft.SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Using Microsoft.SharePoint.dll to find out the ID of a list</title><content type='html'>When moving a site between web applications using SharePoint Designer backup (&lt;strong&gt;Site &gt; Administration &gt; Backup Web Site&lt;/strong&gt; menu), several web parts wich had been converted to XSLT were displaying a "strange" message:&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator&lt;/em&gt;.&lt;/p&gt;&lt;/blockquote&gt;When an web part is converted to XSLT, SharePoint Designer places on the page a control of type &lt;strong&gt;WebPartPages:DataFormWebPart&lt;/strong&gt; to display the data. This control uses the list ID to specify wich list is the data source (each list in a SharePoint site is given a &lt;a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier"&gt;GUID&lt;/a&gt; as its identifier, wich is stored in the list's ID property). Well, when the site was recreated at the destination, so were its lists, and that generated new ID's to them. And the web parts could not find their lists anymore, so they stopped working.&lt;br /&gt;&lt;br /&gt;Being a restless geek, I decided to test the classes on &lt;strong&gt;Microsoft.SharePoint.dll&lt;/strong&gt; by coding a little console app that listed the ID's from a SharePoint site lists. The code is bellow, and can be used as an intro to classes in namespace &lt;strong&gt;Microsoft.SharePoint&lt;/strong&gt;. If you want just the app, just download the following file and run it from a command prompt on your SharePoint machine: &lt;a href="http://cid-e26f249e4fc7b6ed.skydrive.live.com/self.aspx/Arquivos%20P%c3%bablicos/SPListID.zip"&gt;SPListId.zip&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class="codigo" style="HEIGHT: 400px"&gt;Imports Microsoft.SharePoint&lt;br /&gt;&lt;br /&gt;Module Module1&lt;br /&gt;&lt;br /&gt;    Sub Main()&lt;br /&gt;        Try&lt;br /&gt;            Console.WriteLine()&lt;br /&gt;            If My.Application.CommandLineArgs.Count = 0 Then&lt;br /&gt;                Console.WriteLine("SPListId - Lists IDs from lists in a SharePoint site")&lt;br /&gt;                Console.WriteLine("Copyright (c) 2010 SrNimbus. No rights reserved ;)")&lt;br /&gt;                Console.WriteLine("Usage: SPListId site_url")&lt;br /&gt;                Return&lt;br /&gt;            End If&lt;br /&gt;            ' The System.Uri class helps manipulating network addresses&lt;br /&gt;            Dim urlSite As Uri = New Uri(My.Application.CommandLineArgs(0))&lt;br /&gt;            ' The Microsoft.SharePoint.SPSite class represents a site collection on SharePoint&lt;br /&gt;            Dim siteCollection As New SPSite(urlSite.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped))&lt;br /&gt;            ' The Microsoft.SharePoint.SPWeb class represents a site on a site collection&lt;br /&gt;            Dim site As SPWeb = siteCollection.OpenWeb(urlSite.AbsolutePath)&lt;br /&gt;            Console.WriteLine("Lists on {0}:", urlSite.OriginalString)&lt;br /&gt;            Console.WriteLine("------------------------------------")&lt;br /&gt;            ' The SPList class represents a SharePoint list&lt;br /&gt;            For Each lista As SPList In site.Lists&lt;br /&gt;                Console.WriteLine("{0}: {{{1}}}", lista.Title, lista.ID.ToString().ToUpper())&lt;br /&gt;            Next&lt;br /&gt;            Console.WriteLine("------------------------------------")&lt;br /&gt;        Catch erro As Exception&lt;br /&gt;            Console.WriteLine("Ooops:")&lt;br /&gt;            Console.WriteLine("{0} - {1}", erro.Source, erro.Message)&lt;br /&gt;        Finally&lt;br /&gt;            Console.WriteLine()&lt;br /&gt;        End Try&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;End Module&lt;/pre&gt;&lt;br /&gt;Remember to add a reference to Microsoft.SharePoint.dll in order to compile the project. It is located on the SharePoint server, at &lt;em&gt;%ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI&lt;/em&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-737406438897825464?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/737406438897825464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/02/using-microsoftsharepointdll-to-find.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/737406438897825464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/737406438897825464'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/02/using-microsoftsharepointdll-to-find.html' title='Using Microsoft.SharePoint.dll to find out the ID of a list'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-6088111568143183977</id><published>2010-01-25T00:00:00.007-02:00</published><updated>2010-01-25T00:21:45.278-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Content Deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>SharePoint 2007 Content Deploy Quick Start Guide</title><content type='html'>And there was I working my 455 off preparing for teach Microsoft´s 50149 SharePoint Operations training when...&lt;br /&gt;&lt;blockquote&gt;&lt;em&gt;&lt;span style="color:#333333;"&gt;A word of advise: stay away from this training. The author tries to show EVERYTHING about SharePoint operations but there's no details on *any* of the topics shown. The result is frustrated and/or distracted students, and that's a saddening thing to me as an instructor - not to mention to the students...&lt;/span&gt;&lt;/em&gt;&lt;/blockquote&gt;Well, there I was studying the module on Content Deployment when I stumbled upon this guide from Stefan Gossner (great SharePoint blog!). It gives a quick and straightforward view on the main points about Content Deplyment on SharePoint 2007. Nice reading if you are new to the subject. Till now, the guide covers the following:&lt;br /&gt;&lt;br /&gt;Part 1 - The Basics&lt;br /&gt;Part 2 - The Basics continued&lt;br /&gt;Part 3 - Configuration&lt;br /&gt;Part 4 - Communication&lt;br /&gt;Part 5 - Quick Deployment&lt;br /&gt;Part 6 - Logging&lt;br /&gt;Part 7 - Change Token Basics&lt;br /&gt;Part 8 - Job and Change Token&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.technet.com/stefan_gossner/archive/2009/10/30/content-deployment-the-complete-guide-part-1-the-basics.aspx"&gt;Part 1&lt;/a&gt; has an link index to the other parts. Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-6088111568143183977?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/6088111568143183977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2010/01/sharepoint-2007-content-deploy-quick.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/6088111568143183977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/6088111568143183977'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2010/01/sharepoint-2007-content-deploy-quick.html' title='SharePoint 2007 Content Deploy Quick Start Guide'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-5422410769477199521</id><published>2009-12-29T10:16:00.008-02:00</published><updated>2009-12-30T00:14:46.266-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Virtual PC'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtualization Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtual PC'/><title type='text'>Windows Virtual PC: Where is it?</title><content type='html'>&lt;span style="FONT-STYLE: italic"&gt;Windows Virtual PC&lt;/span&gt; is Microsoft Virtual PC next version. It runs on Windows 7, but it is NOT part of it - you have to download it. The download page is &lt;a href="http://www.microsoft.com/windows/virtual-pc/download.aspx"&gt;http://www.microsoft.com/windows/virtual-pc/download.aspx&lt;/a&gt;, although the page title is "Download Windows XP Mode". You have to fill in the two dropdowns, and the page shows you two links. If you don't want &lt;a href="http://www.microsoft.com/windows/virtual-pc/default.aspx"&gt;Windows XP Mode&lt;/a&gt;, just click the second link, download and install the update to Windows 7 - it's Windows Virtual PC that's being installed.&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_YdLjqqhyG_E/Szn2Oa_o9HI/AAAAAAAAANU/FIejpBaa_Dc/s1600-h/windows-virtualpc-link.jpg"&gt;&lt;img style="CURSOR: pointer" id="BLOGGER_PHOTO_ID_5420634354141951090" border="0" alt="" src="http://1.bp.blogspot.com/_YdLjqqhyG_E/Szn2Oa_o9HI/AAAAAAAAANU/FIejpBaa_Dc/s320/windows-virtualpc-link.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Before you download it, you have to check if your's computer processor supports &lt;a href="http://en.wikipedia.org/wiki/Hardware-assisted_virtualization"&gt;&lt;span style="FONT-STYLE: italic"&gt;hardware virtualization technology&lt;/span&gt;&lt;/a&gt; (check out the links on &lt;a href="http://en.wikipedia.org/wiki/Intel_VT#Intel_Virtualization_Technology_for_x86_.28Intel_VT-x.29"&gt;Intel&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/AMD-V#AMD_virtualization_.28AMD-V.29"&gt;AMD&lt;/a&gt; on the article). Most of the newer processors (post 2006-) ship with it. Some don't (for example, the T6670 on my Dell Vostro 1310 does not :-P). You can run the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0ee2a17f-8538-4619-8d1c-05d27e11adb2&amp;amp;displaylang=en"&gt;Hardware-Assisted Virtualization Detection Tool from Microsft&lt;/a&gt; to confirm that your processor supports VT (virtualization technology). If it doesn't, download &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=28C97D22-6EB8-4A09-A7F7-F6C7A1F000B5&amp;amp;displaylang=en"&gt;Virtual PC 2007&lt;/a&gt;, the previous Windows Virtual PC version. It has less features, but it's disks are compatible with Windows VPC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-5422410769477199521?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/5422410769477199521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/windows-virtual-pc-where-is-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5422410769477199521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5422410769477199521'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/windows-virtual-pc-where-is-it.html' title='Windows Virtual PC: Where is it?'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_YdLjqqhyG_E/Szn2Oa_o9HI/AAAAAAAAANU/FIejpBaa_Dc/s72-c/windows-virtualpc-link.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-935547119469175701</id><published>2009-12-24T09:24:00.002-02:00</published><updated>2009-12-24T09:30:15.367-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virtual Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='Virtual PC'/><title type='text'>Disk space used by an Windows 2003 Clean Install</title><content type='html'>Old one, but just for the record: a fresh Windows 2003 Standard + IIS + SP2 takes 5.74 Gb on the disk. In case you need to build a VM with that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-935547119469175701?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/935547119469175701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/disk-space-used-by-windows-2003-clean.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/935547119469175701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/935547119469175701'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/disk-space-used-by-windows-2003-clean.html' title='Disk space used by an Windows 2003 Clean Install'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-4614762456272615887</id><published>2009-12-18T21:42:00.003-02:00</published><updated>2009-12-18T22:25:12.706-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>SELECT * FROM Table JOIN... ListBox???</title><content type='html'>A Linq way to retrive rows from one table based on rows from a related table whose lines are loaded into a listbox.&lt;br /&gt;&lt;br /&gt;The ASP.NET test WebForm:&lt;br /&gt;&lt;br /&gt;&lt;img style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid" src="http://mxgv5q.blu.livefilestore.com/y1pt2-GqjOy7TCsbI3SJT4JFPLmbAldHF5LAt2gmCxwaiGVTQdeI4cKzReAFK2MpCltxlQ9vjHKA7L1lKlRioRMyJfdC45NaXFQ/categories-products.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;I want all products related to the selected catego&lt;u&gt;ries&lt;/u&gt; (ListBox.SelectionMode = Multiple). The project is an ASP.NET Web App on VS 2010 Beta 2, and it contains an Entity Data Model on the Northwind sample database.&lt;br /&gt;&lt;br /&gt;The LinkButton code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="codigo"&gt;    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LinkButton1.Click&lt;br /&gt;        Dim data As New NorthwindEntities&lt;br /&gt;        Dim selectedCategoriesProducts As New List(Of Products)&lt;br /&gt;        selectedCategoriesProducts = _&lt;br /&gt;            (From line As Products In data.Products&lt;br /&gt;             Join item As Integer In (From x In ListBox1.Items Where x.Selected = True Select x.value)&lt;br /&gt;             On line.CategoryID Equals item&lt;br /&gt;             Select line).ToList()&lt;br /&gt;        GridView1.DataSource = selectedCategoriesProducts&lt;br /&gt;        GridView1.DataBind()&lt;br /&gt;    End Sub&lt;/pre&gt;The Linq (to Entity) query joins the Products table (&lt;strong&gt;data.Products&lt;/strong&gt;) to a integer list (&lt;strong&gt;Join item As Integer&lt;/strong&gt;). The integer list is generated by a Linq (to Objects) query that selects the values (&lt;strong&gt;Select x.value&lt;/strong&gt;) from the listbox options (&lt;strong&gt;ListBox1.Items&lt;/strong&gt;) that are checked (&lt;strong&gt;Where x.Selected = True&lt;/strong&gt;). The returned Products object list is then shown on the GridView.&lt;br /&gt;&lt;br /&gt;In other words, we joined the Products table on Nortwind database with the ListBox selected items from an webform. Well, talk about data source abstraction... :-)&lt;br /&gt;&lt;br /&gt;&lt;div align="right"&gt;&lt;em&gt;"Linq Is Fun!!!"&lt;/em&gt;&lt;/div&gt;&lt;div align="right"&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Buda On Using Linq To Query Data&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-4614762456272615887?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/4614762456272615887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/select-from-table-join-listbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4614762456272615887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4614762456272615887'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/12/select-from-table-join-listbox.html' title='SELECT * FROM Table JOIN... ListBox???'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-5999964674209656151</id><published>2009-11-09T18:16:00.001-02:00</published><updated>2009-11-09T18:16:39.804-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='DevTableGen'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='MSBuild'/><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Table Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Blend'/><title type='text'>Visual Studio: how to target different .NET Framework versions</title><content type='html'>&lt;p&gt;We are creating a WPF application on Visual Studio 2010 (beta 1), but Blend 3 doesn’t load .NET Framework 4.0 assemblies. So on the designer’s machine we had to compile the solution targeting .NET Framework version 3.5.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;(quick thought: our development team is made up of one designer, one product manager, and one project manager. So, WHO IS CODING???)&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We found an article on MSBuild – Microsoft’s build engine – about the &lt;strong&gt;/toolsversion&lt;/strong&gt; option, that targets specific .NET Framework versions. We built a .bat file that recompiles all projects in the solution. Following is some of it:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;msbuild &lt;/strong&gt;StorageClient\StorageClient.csproj &lt;strong&gt;/toolsversion:3.5&lt;/strong&gt; /verbosity:quiet       &lt;br /&gt;if ERRORLEVEL 1 goto erro&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;MSBuild recognizes Visual Studio project files, and activates the corresponding compiler. The &lt;strong&gt;/toolsversion&lt;/strong&gt; option selects the target .NET Framework version (allowed values are &lt;strong&gt;2.0&lt;/strong&gt;, &lt;strong&gt;3.0&lt;/strong&gt;, &lt;strong&gt;3.5&lt;/strong&gt; and &lt;strong&gt;4.0&lt;/strong&gt;), and overrides the selected version on the project file. The following “&lt;strong&gt;if&lt;/strong&gt;” checks if MSBuild returned 1, which signals an error, so you can stop the build job (using good(?) old &lt;strong&gt;goto&lt;/strong&gt;). &lt;/p&gt;  &lt;p&gt;A lot less painful than I thought. The same batch will be used to generate a 3.5 version of the solution when building the tables on Azure Development Storage, because DevTableGen – the utility that builds the tables – also does not support 4.0 .NET Framework assemblies. &lt;/p&gt;  &lt;p&gt;MSBuild location is not included on the standard command prompt path, so use Visual Studio 2010 command prompt (VS 2010 program group &amp;gt; Visual Studio 2010 Tools).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-5999964674209656151?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/5999964674209656151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/11/visual-studio-how-to-target-different.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5999964674209656151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5999964674209656151'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/11/visual-studio-how-to-target-different.html' title='Visual Studio: how to target different .NET Framework versions'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-7884575971475017368</id><published>2009-10-26T12:15:00.004-02:00</published><updated>2009-10-26T12:47:22.151-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>INSERT's inside transactions</title><content type='html'>Are you a geek? Then read on. :-)&lt;br /&gt;&lt;br /&gt;Reading &lt;a href="http://technet.microsoft.com/en-us/library/cc505820.aspx"&gt;Inside SQL Server 2005: Query Tunning and Optimization&lt;/a&gt;, I stumbled upon this beaultiful code sample. The guy (yes, a &lt;em&gt;guy&lt;/em&gt; - it seems Ms. Delaney is subcontracting for some chapters...) creates a big sample table with 250,000 rows on it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://uelfla.blu.livefilestore.com/y1p4ejgCHVtuq8WXVUNZHGj8eROYt7QTKNh28U3P0FJH5d8Ox3BcaXiNeGpSVdnTleGc4wSbbPZ2w-IxIEwSz8B5uT4gEBLh1Jq/insert-inside-transaction.gif"&gt;&lt;img style="WIDTH: 553px; HEIGHT: 534px; CURSOR: hand" border="0" alt="" src="http://uelfla.blu.livefilestore.com/y1p4ejgCHVtuq8WXVUNZHGj8eROYt7QTKNh28U3P0FJH5d8Ox3BcaXiNeGpSVdnTleGc4wSbbPZ2w-IxIEwSz8B5uT4gEBLh1Jq/insert-inside-transaction.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p align="justify"&gt;And there's not a single shred of comment about the code. He's doing 250,000 INSERT's on a table. In order to optimize it, he opens a transaction right before the loop starts, and on every 1,000 INSERT's he does a COMMIT then opens another transaction. This prevents SQL Server from opening a transaction on each INSERT. (Yes, Luke. When a data modification command to SQL Server you send, a transaction it automatically opens if the command is not already inside one. This allows you, for example, to change your mind and issue a ROLLBACK inside a trigger - even without a preceding BEGIN TRAN).&lt;/p&gt;&lt;p align="justify"&gt;By using the explicit transactions around the INSERT's, the code runs them on 250 transactions, instead of 250 &lt;em&gt;thousand&lt;/em&gt; ones. As I've said before, beaultiful. Simply &lt;em&gt;beaultiful&lt;/em&gt;.&lt;/p&gt;&lt;p align="justify"&gt;And in case you didn't notice: yes, I'm a geek. :-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-7884575971475017368?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/7884575971475017368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/inserts-inside-transactions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7884575971475017368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7884575971475017368'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/inserts-inside-transactions.html' title='INSERT&apos;s inside transactions'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-2619737031300874683</id><published>2009-10-22T05:27:00.009-02:00</published><updated>2009-10-26T12:12:56.837-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Compact is not intended for ASP.NET development</title><content type='html'>SQL Server Compact is a very restricted SQL Server edition in terms of features. But it runs &lt;em&gt;in-process&lt;/em&gt;, wich means it does not run as a service being accessed from your application, like others SQL Sever editions. It runs &lt;em&gt;inside&lt;/em&gt; your app. This allows for simplified deploy (non-administrative accounts can install an application using SQL Server CE databases), and reduced RAM, CPU and disk usage. It runs even on Windows Mobile!&lt;br /&gt;&lt;br /&gt;Well, if you try to use it on an ASP.NET site, you end up with the error "SQL Server Compact is not intended for ASP.NET development". The reason is, like the message says, SQL Server CE is not made to be used on a multi-user environment like a web aplication. But if you want to use it anyway, for exampe for a quick test, place the following code on Global.asax:&lt;br /&gt;&lt;br /&gt;&lt;div class="codigo"&gt;&lt;br /&gt;Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;   AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", True)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This way you are "taking full responsability" for using SQL Server CE on the ASP.NET site, and the error won't show up again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-2619737031300874683?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/2619737031300874683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/sql-server-compact-is-not-intended-for_22.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/2619737031300874683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/2619737031300874683'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/sql-server-compact-is-not-intended-for_22.html' title='SQL Server Compact is not intended for ASP.NET development'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-5490496780496869005</id><published>2009-10-22T05:00:00.005-02:00</published><updated>2009-10-22T05:27:06.826-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET: Framework 3.5 is not showing up on IIS</title><content type='html'>When configuring an ASP.NET site on IIS Manager, on the site (or virtual directory) property pages, there is a ASP.NET configuration section. But in the "ASP.NET version" list, version 3.5 (or 3.51, or 3.51 SP1) does not show up:&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://uelfla.blu.livefilestore.com/y1pD_EO5FXAP0i_Mp99rfzOqzJCEsmFxn4JptcyVAk1OSiOlbNDGXrLlPcr4vHtAVBHeQyeXXl2SblcjkAA6qaXiX46P2mWo8m-/ASPNET-IIS.jpg"&gt;&lt;img style="WIDTH: 350px; HEIGHT: 342px; CURSOR: hand" border="0" alt="" src="http://uelfla.blu.livefilestore.com/y1pD_EO5FXAP0i_Mp99rfzOqzJCEsmFxn4JptcyVAk1OSiOlbNDGXrLlPcr4vHtAVBHeQyeXXl2SblcjkAA6qaXiX46P2mWo8m-/ASPNET-IIS.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;According to &lt;a href="http://blogs.msdn.com/vijaysk/archive/2008/03/20/running-asp-net-3-5-on-iis.aspx"&gt;a post by Vijayshinva Karnure from Microsoft&lt;/a&gt;, this is the expected behavior. 3.x .NET Framework versions are not "complete" frameworks, like 1.0, 1.1 and 2.0 versions. They build up on version 2.0 with new controls, new classes to FCL, but the "infrastructure" used is from version 2.0. So, if you are deploying an ASP.NET site built on Visual Studio 2008, select version 2.0 on ASP.NET version list at IIS Manager. If .NET Framwork 3.5 is installed on the deployment machine, the site configuration is correct.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-5490496780496869005?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/5490496780496869005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/framework-35-is-not-showing-up-on-iis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5490496780496869005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/5490496780496869005'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/framework-35-is-not-showing-up-on-iis.html' title='ASP.NET: Framework 3.5 is not showing up on IIS'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-4091201942927283313</id><published>2009-10-19T01:02:00.003-02:00</published><updated>2009-10-19T01:40:41.174-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AdventureWorks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>AdventureWorks: just the MDF, please!!!</title><content type='html'>I find the K.I.S.S principle kind of offensive, but sometimes people ask for it. There's a bunch of guys developing a whole &lt;span style="font-style: italic;"&gt;project&lt;/span&gt; on Codeplex to create a setup program for the AdventureWorks family of SQL Server sample databases. I wonder, is it &lt;span style="font-style: italic;"&gt;so&lt;/span&gt; complicated to install a few databases? After all, people who will use it are &lt;span style="font-style: italic;"&gt;very&lt;/span&gt; likely to be dba's or developers, and they certainly have some knowledge on SQL Server administration, or can understand some half-page instructions on how to restore a database backup or how to attach a database file.&lt;br /&gt;&lt;br /&gt;Well, I needed the database. Downloaded the MSI for SQL Server 2008, and ran it. On setup things started to go south: setup asks for the instance on wich to install the databases, and presented me a list with the instances on my machine. I had only a default SQL Server Express instance. I selected it, but the "Next" button kept grayed, no matter what.&lt;br /&gt;&lt;br /&gt;"Ok". Cancel setup. Go to Google and asks for "SQL Server Express AdventureWorks". There's a bunch of posts with some tortuous ways of doing it. One said, "run script instblablabla.sql installed with the MSI from Management Studio". Loaded the script - 190Kb (!). It creates the empty database structures and loads data from several CSV files that comes with the MSI too. Nope. Few errors, some restriction on having to enable FILESTREAM on SQL Server Express - unfortunatelly, my SQL Server Express installation is a x86 on top of Vista x64, and after some more Googling, I learned that this FILESTREAM stuff does not work on this scenario. But WHY do I need it??? Seems it is used to load data from the CSVs into the tables. &lt;span style="font-style: italic;"&gt;[Sigh].&lt;/span&gt; Think &lt;span style="font-style: italic;"&gt;"complicated&lt;/span&gt;". Then double it.&lt;br /&gt;&lt;br /&gt;Finally  I lost my patience and downloaded the SQL Server &lt;span style="font-weight: bold;"&gt;*2005*&lt;/span&gt; version of AdventureWorks - from the Codeplex site itself. Extracted the MSI content and there they are, sitting beautifully on some subdir, the MDF and LDF files to the database. Attached them to my SQL Server Express that, inspite of being a 2008 installation, reads the 2005 MDF files without problems. Quick. Simple.&lt;br /&gt;&lt;br /&gt;The MSI with the database files can be downloaded from &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004"&gt;http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004&lt;/a&gt;. Select the "&lt;span style="font-weight: bold;"&gt;AdventureWorksDB.msi&lt;/span&gt;" option.&lt;br /&gt;&lt;br /&gt;To extract the MSI content, run the following command from a command prompt:&lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-weight: bold;"&gt;msiexec -a FileName.MSI -qb TARGETDIR=extract_location_full_path&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;To attach a MDF file to SQL Server Express, open Management Studio and, on Object Browser, right click on "Databases" and select "Attach..."&lt;br /&gt;&lt;br /&gt;Is it really necessary a setup project for &lt;span style="font-style: italic;"&gt;that&lt;/span&gt;???&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-4091201942927283313?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/4091201942927283313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/adventureworks-just-mdf-please.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4091201942927283313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4091201942927283313'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/adventureworks-just-mdf-please.html' title='AdventureWorks: just the MDF, please!!!'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-331570966096841382</id><published>2009-10-11T11:58:00.019-03:00</published><updated>2009-12-24T10:29:53.110-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error Handling'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Global error handling in ASP.NET and Windows Forms</title><content type='html'>You should not let exceptions unhandled in &lt;span style="FONT-STYLE: italic"&gt;*any*&lt;/span&gt; part of your application. But that doesn't mean you have to spray your entire code with a swarm of try/catch blocks. Both Windows Forms and ASP.NET applications offer the possibility to create a &lt;span style="FONT-STYLE: italic"&gt;global error handler&lt;/span&gt;, that will be activated whenever an unhandled exception (i.e., an exception that has not happened inside a try/catch block) occurs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Windows Forms Global Exception Handler&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As always, things are easier in Windows Forms than in ASP.NET. Windows Forms provides the developer with the Application object, that among other things has the ThreadException event. Basically, all you have to do is to add an even handler to the ThreadException event, and your global event handler is set.&lt;br /&gt;&lt;br /&gt;Create a new VB.NET Windows Forms project, add a button to the Form1 form, and replace its code with the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="HEIGHT: 300px" class="codigo"&gt;&lt;pre&gt;&lt;br /&gt;Imports System.Diagnostics&lt;br /&gt;&lt;br /&gt;Public Class Form1&lt;br /&gt;&lt;br /&gt;  Const MYAPP_SOURCE_NAME As String = "My Application"&lt;br /&gt;&lt;br /&gt;  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;      ' Creates the event source on Windows Application Log&lt;br /&gt;      ' This has to be done only once, usually during app setup&lt;br /&gt;      If Not EventLog.SourceExists(MYAPP_SOURCE_NAME) Then&lt;br /&gt;          EventLog.CreateEventSource(MYAPP_SOURCE_NAME, "Application")&lt;br /&gt;      End If&lt;br /&gt;      ' Designates the global error handler&lt;br /&gt;      AddHandler Application.ThreadException, AddressOf Me.TheGlobalErrorHandler&lt;br /&gt;  End Sub&lt;br /&gt;&lt;br /&gt;  Sub TheGlobalErrorHandler(ByVal sender As Object, ByVal e As Threading.ThreadExceptionEventArgs)&lt;br /&gt;      ' This is how we get the exception data&lt;br /&gt;      Dim unhandledException As Exception = e.Exception&lt;br /&gt;      ' Writes technical error information to the Application Log&lt;br /&gt;      EventLog.WriteEntry(MYAPP_SOURCE_NAME, _&lt;br /&gt;          "Unhandled error: " + vbNewLine + unhandledException.ToString(), _&lt;br /&gt;          EventLogEntryType.Error)&lt;br /&gt;      ' Some nice message to the user&lt;br /&gt;      MsgBox("An unexpected error has occured. Technical error information " &amp;amp; _&lt;br /&gt;          "has been writen to the Windows Application Log.", _&lt;br /&gt;          MsgBoxStyle.Critical)&lt;br /&gt;  End Sub&lt;br /&gt;&lt;br /&gt;  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;      ' Simulates an unhandled exception&lt;br /&gt;      Throw New Exception("Oh oh error accessing the database")&lt;br /&gt;  End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Click on the button to simulate an unhadled exception. A message is displayed and if you look at the Windows Application Log on EventViewer (&lt;span style="FONT-WEIGHT: bold"&gt;Start&lt;/span&gt; &gt; &lt;span style="FONT-WEIGHT: bold"&gt;Run&lt;/span&gt; &gt; &lt;span style="FONT-STYLE: italic"&gt;eventvwr.msc&lt;/span&gt;), there it is the exception.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;ASP.NET Global Exception Handler&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ASP.NET provides you with the Application_Error global application event, that is fired whenever an unhandled exception occurs. This event handler belongs to the &lt;span style="FONT-STYLE: italic"&gt;global application class&lt;/span&gt;, as Visual Studio calls it. The global application class code is located on the Global.asax file. ASP.NET applications, by default, don't have a Global.asax file. You can add one by going to the &lt;span style="FONT-WEIGHT: bold"&gt;Project &lt;/span&gt;menu and selecting &lt;span style="FONT-WEIGHT: bold"&gt;Add New Item&lt;/span&gt; &gt; &lt;span style="FONT-WEIGHT: bold"&gt;Global Application Class&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;On the Application_Error event handler code, you have to use two special methods:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Server.GetLastError()&lt;/span&gt; gives access to the unhandled exception.&lt;/li&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Server.ClearError()&lt;/span&gt; prevents ASP.NET from showing the default error page.&lt;/li&gt;&lt;/ul&gt;Create a new ASP.NET Web Application, add a Global.asax file to it, and replace the code in Global.asax.vb with the following:&lt;br /&gt;&lt;div style="HEIGHT: 300px" class="codigo"&gt;&lt;pre&gt;&lt;br /&gt;Imports System.Web.SessionState&lt;br /&gt;Imports System.Diagnostics&lt;br /&gt;&lt;br /&gt;Public Class Global_asax&lt;br /&gt;  Inherits System.Web.HttpApplication&lt;br /&gt;&lt;br /&gt;  Const MYAPP_SOURCE_NAME As String = "My Application"&lt;br /&gt;&lt;br /&gt;  Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;      ' Creates the event source on Windows Application Log&lt;br /&gt;      ' This has to be done only once, usually during app setup&lt;br /&gt;      If Not EventLog.SourceExists(MYAPP_SOURCE_NAME) Then&lt;br /&gt;          EventLog.CreateEventSource(MYAPP_SOURCE_NAME, "Application")&lt;br /&gt;      End If&lt;br /&gt;  End Sub&lt;br /&gt;&lt;br /&gt;  Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;      ' Stores the unhandled exception&lt;br /&gt;      Dim unhandledException As Exception = Server.GetLastError()&lt;br /&gt;      ' Says to the Framework "Don't show default error page - we will handle it"&lt;br /&gt;      Server.ClearError()&lt;br /&gt;      ' Writes techinical error information to the Application Log&lt;br /&gt;      EventLog.WriteEntry(MYAPP_SOURCE_NAME, _&lt;br /&gt;          "Unhandled error: " + vbNewLine + unhandledException.ToString(), _&lt;br /&gt;          EventLogEntryType.Error)&lt;br /&gt;      ' Redirects user to some page with nice error message&lt;br /&gt;      Response.Redirect("/error.aspx")&lt;br /&gt;  End Sub&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Create a page named "error.aspx"; that's the page users will be redirected to after an unhandled exception.&lt;br /&gt;&lt;br /&gt;Finnaly, add a Button to Default.aspx, and replace its code with the following:&lt;br /&gt;&lt;div class="codigo"&gt;&lt;pre&gt;&lt;br /&gt;Partial Public Class _Default&lt;br /&gt;  Inherits System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click&lt;br /&gt;      ' Simulates an unhandled exception&lt;br /&gt;      Throw New Exception("Oh oh that database access error again")&lt;br /&gt;  End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Click on the button and you will be redirected to error.aspx, and an event will be logged on the Application Log with the exception data.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#333333;"&gt;&lt;b&gt;UPDATE:&lt;/b&gt; the &lt;strong&gt;Application_Start&lt;/strong&gt; code will fail on Windows Vista &amp;amp; Windows 7, because of tightened security. The code tries to create an event source in order to log events to it. The methods &lt;strong&gt;EventLog.SourceExists()&lt;/strong&gt; and &lt;strong&gt;EventLog.Create()&lt;/strong&gt; both try to scan the Windows Logs to check if the specified source exists, &lt;/span&gt;but access to the Security Log by ASP.NET apps is not allowed by default. There are several ways to "do it right", but a quick and dirty solution is to create the following registry key: &lt;strong&gt;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\eventlog\Application\YOUR_APP_NAME&lt;/strong&gt;, changing YOUR_APP_NAME to the event log source you want to create. A possible way to "do it right" is to create a command line app containing the Application_Start code, and set it to run from your site's setup package.&lt;/span&gt;&lt;br /&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-331570966096841382?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/331570966096841382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/global-error-handling-in-aspnet-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/331570966096841382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/331570966096841382'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/global-error-handling-in-aspnet-and.html' title='Global error handling in ASP.NET and Windows Forms'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-7756731377812206585</id><published>2009-10-08T15:49:00.000-03:00</published><updated>2009-10-11T03:15:43.738-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Compact is not intended for ASP.NET development</title><content type='html'>The exception "SQL Server Compact is not intended for ASP.NET development" is thrown when you try to use a SQL Server Compact Edition Database on an ASP.NET web site. That's because, as the message says, SQL Server CE was not made to be used on ASP.NET, because of its several restrictions relating "normal" SQL Server editions. If you cannot install a Standart or Developer Edition SQL Server on your development machine, try using &lt;a href="http://www.google.com.br/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=4&amp;amp;ved=0CBIQFjAD&amp;amp;url=http%3A%2F%2Fwww.microsoft.com%2Fexpress%2Fsql%2Fdefault.aspx&amp;amp;ei=s3fRSqLLHIeLuAflpbiFCQ&amp;amp;rct=j&amp;amp;q=sql+express+download+site%3Amicrosoft.com&amp;amp;usg=AFQjCNH5AbkINDcxSc0nkPt87Q7twDQa5g"&gt;Express Edition&lt;/a&gt;. It has everything a developer needs and it's free.&lt;br /&gt;&lt;br /&gt;If you &lt;span style="font-style: italic;"&gt;really &lt;/span&gt;want to use Compact Edition, add the following to your Global.asax file and the exception will go away:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;       AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", True)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-7756731377812206585?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/7756731377812206585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/sql-server-compact-is-not-intended-for.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7756731377812206585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7756731377812206585'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/sql-server-compact-is-not-intended-for.html' title='SQL Server Compact is not intended for ASP.NET development'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-7672319550275569410</id><published>2009-10-04T10:39:00.001-03:00</published><updated>2009-10-11T03:03:21.031-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virtual Server'/><title type='text'>Virtual Server: VM's not starting</title><content type='html'>Virtual Server has a Administration Website, from where you start VM's. It seems that the site does not work on IE8 or FireFox 3 for some operations, starting VM's being one of them (another: changing virtual hard disk type from IDE to SCSI). The IE status bar showed "Error on page", just like when you load a page with JavaScript errors on it. Well, I'm not sure what was going on, but if you select the Compatibility View mode on IE, the page runs ok.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_YdLjqqhyG_E/StF1AQY5aHI/AAAAAAAAABc/D39_2laDURA/s1600-h/ie-modo-exibicao-compatibilidade.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 69px;" src="http://2.bp.blogspot.com/_YdLjqqhyG_E/StF1AQY5aHI/AAAAAAAAABc/D39_2laDURA/s320/ie-modo-exibicao-compatibilidade.jpg" alt="" id="BLOGGER_PHOTO_ID_5391218876199037042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-7672319550275569410?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/7672319550275569410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/virtual-server-vms-not-starting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7672319550275569410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/7672319550275569410'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/virtual-server-vms-not-starting.html' title='Virtual Server: VM&apos;s not starting'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_YdLjqqhyG_E/StF1AQY5aHI/AAAAAAAAABc/D39_2laDURA/s72-c/ie-modo-exibicao-compatibilidade.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-191319660709906541</id><published>2009-10-02T11:33:00.000-03:00</published><updated>2009-10-11T02:45:06.157-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><title type='text'>400 Bad Request accessing Azure Blob Storage</title><content type='html'>This one was kind of dumb. I'm posting it in hope someone doesn't loose as much time as I've lost. When I was trying to retrive a Blob Container object from Azure Blog Storage, I kept getting a "400 Bad Request" exception. After 3 hours I gave up and asked a friend to look at my code. In 3 minutes he spot the bug: I was using the &lt;span style="font-style: italic;"&gt;Table &lt;/span&gt;Storage credentials on the acces to the Blob Storage.&lt;br /&gt;&lt;br /&gt;Wrong code:&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;BlobStorage blobs = BlobStorage.Create(&lt;br /&gt;StorageAccountInfo.GetDefault&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Table&lt;/span&gt;StorageAccountFromConfiguration());&lt;/span&gt;&lt;/blockquote&gt;Right code:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;BlobStorage blobs = BlobStorage.Create(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    StorageAccountInfo.GetDefault&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;Blob&lt;/span&gt;StorageAccountFromConfiguration());&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;The StorageAccountInfo class has 3 methods to retrieve default credentials: &lt;span style=";font-family:courier new;font-size:85%;"  &gt;GetDefaultTableStorageAccountFromConfiguration()&lt;/span&gt;, &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;GetDefaultBlobStorageAccountFromConfiguration()&lt;/span&gt;&lt;/span&gt;, and &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;GetDefaultQueueStorageAccountFromConfiguration()&lt;/span&gt;&lt;/span&gt;. One for each storage Azure has. Big names with little differences between them...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-191319660709906541?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/191319660709906541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/400-bad-request-accessing-azure-blob.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/191319660709906541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/191319660709906541'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/10/400-bad-request-accessing-azure-blob.html' title='400 Bad Request accessing Azure Blob Storage'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-6081814196195259998</id><published>2009-09-30T17:42:00.002-03:00</published><updated>2009-11-12T21:13:53.981-02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='Azure'/><category scheme='http://www.blogger.com/atom/ns#' term='Table Storage'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>404 Resource Not Found For Segment accessing Azure Table Storage</title><content type='html'>On Windows Azure Table Storage, when you are searching for items (or &lt;span style="FONT-STYLE: italic"&gt;entities&lt;/span&gt;, as the Azure documation calls them) using LINQ on a table, under some circumstances you may get a 404 - Resource Not Found error. That's because Azure Table Storage is REST-based, and REST is about servers serving "resources" to clients. For example, HTTP is REST-based, and when you ask for a file that doesn't exist on a server, you get a "404 Page Not Found" error.&lt;br /&gt;&lt;br /&gt;What is happening is pretty much the same. According to &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/8aab60aa-e00e-45d9-bd37-015fae4b9d21"&gt;a comment by Andrew Conrad&lt;/a&gt;, from Microsoft LINQ To REST project team, if you search a list by its keys, you want a specific resource, and if the resource is not found, the 404 error is generated. This may make sense from a REST point of view, but if I'm accessing a table, if I don't find what I'm looking for, I expect a empty resultset, and not an exception. By Andrew's comment above, the LINQ to REST team is aware of this &lt;span style="FONT-STYLE: italic"&gt;peculiarity &lt;/span&gt;on Azure, and plans on doing something more intuitive in the future.&lt;br /&gt;&lt;br /&gt;For now you will have to use a ugly try/catch block around your code:&lt;br /&gt;&lt;pre class="codigo"&gt;try&lt;br /&gt;{&lt;br /&gt;   var element =&lt;br /&gt;      (for item in azureContext.MyTable&lt;br /&gt;       where item.PartitionKey = '...' and item.RowKey = '...'&lt;br /&gt;       select item).FirstOrDefault();&lt;br /&gt;}&lt;br /&gt;catch (DataServiceQueryException ex)&lt;br /&gt;{&lt;br /&gt;   if(ex.Response.StatusCode == 404)&lt;br /&gt;      // element not found&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-6081814196195259998?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/6081814196195259998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/404-resource-not-found-for-segment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/6081814196195259998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/6081814196195259998'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/404-resource-not-found-for-segment.html' title='404 Resource Not Found For Segment accessing Azure Table Storage'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-3975215421007131310</id><published>2009-09-28T23:45:00.001-03:00</published><updated>2009-10-11T01:59:17.852-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='SCC'/><title type='text'>Multiple Check-outs on TFS</title><content type='html'>Team Foundation Server Source Code Control comes with default options that can cause some problems to developers coming from Visual SourceSafe.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Multiple check-outs of the same file are allowed by default. When you try to check in code that has been modified by another developer, a merge conflicts screen appears for you to select what you want to keep and what you want to discard, from yours modifications and from other's too. That can be quite a pain if the file has been through many modifications.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Receiving the latest version of a file on check-out is *&lt;span style="font-style: italic;"&gt;not&lt;/span&gt;* a default setting. So, even if you disable multiple check-outs, you may still find yourself at the merge conflicts screen, because you worked on code that doesn't have the most recent modifications made to it.&lt;/li&gt;&lt;/ol&gt;If you like single check-out and think modifications merging is a bad ideia, you have to change the default TFS SCC options. Open the project on Team Explorer, double click &lt;span style="font-weight: bold;"&gt;Source Code&lt;/span&gt; and, on the &lt;span style="font-weight: bold;"&gt;Team &lt;/span&gt;menu, select &lt;span style="font-weight: bold;"&gt;Team Project Settings&lt;/span&gt; &gt; &lt;span style="font-weight: bold;"&gt;Source Control&lt;/span&gt;. Then, reverse selections:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_YdLjqqhyG_E/StFktYMFAeI/AAAAAAAAABU/nEK_fAA1fks/s1600-h/TFS-SCC-checkout-options.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="http://2.bp.blogspot.com/_YdLjqqhyG_E/StFktYMFAeI/AAAAAAAAABU/nEK_fAA1fks/s320/TFS-SCC-checkout-options.jpg" alt="" id="BLOGGER_PHOTO_ID_5391200959689196002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;That way there will be no two developers working on the same code at the same time, and you will always be editing the latest version of any code you check out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-3975215421007131310?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/3975215421007131310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/multiple-check-outs-on-tfs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3975215421007131310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/3975215421007131310'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/multiple-check-outs-on-tfs.html' title='Multiple Check-outs on TFS'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_YdLjqqhyG_E/StFktYMFAeI/AAAAAAAAABU/nEK_fAA1fks/s72-c/TFS-SCC-checkout-options.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-380006356619613701</id><published>2009-09-14T15:26:00.001-03:00</published><updated>2009-10-11T01:26:46.600-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>STSADM: Access Denied</title><content type='html'>You may get an "Access Denied" error running the SharePoint command-line administration tool &lt;span style="font-weight: bold;"&gt;stsadm.exe&lt;/span&gt; on Windows 2008, even if you are loggend in with an administrator account. One possible reason for that is UAC (User Access Control). According to &lt;a href="http://technet.microsoft.com/en-us/library/cc709691%28WS.10%29.aspx"&gt;the UAC Guide on TechNet&lt;/a&gt;, administrators receives two credentials set when they log on: a "normal use" credential and an "administrative" credential. That's because on Vista and W2008 an application may mark itself as administrative task, and when someone tries to start that application, UAC shows the "Windows needs your permission to continue" dialog box:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://uelfla.blu.livefilestore.com/y1phiai2LyfeL6w96j6B7jnZ3x94piNHLcEPvEUK3RkRch8q5AzXkc_73k4lu7dtIaafnq8V1eCel-k0soeBuGg04IyvtUew-s-/UAC.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 441px; height: 251px;" src="http://uelfla.blu.livefilestore.com/y1phiai2LyfeL6w96j6B7jnZ3x94piNHLcEPvEUK3RkRch8q5AzXkc_73k4lu7dtIaafnq8V1eCel-k0soeBuGg04IyvtUew-s-/UAC.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When you click "Continue", Windows uses the "administrative portion of your logon credentials" to run the application.&lt;br /&gt;&lt;br /&gt;The problem is when this dialog box is not shown. For instance, when you open a command prompt and try to run &lt;span style="font-weight: bold;"&gt;stsadm.exe&lt;/span&gt;. You simply get and "Access Denied" message. That's because the command prompt trying to run &lt;span style="font-weight: bold;"&gt;stsadm&lt;/span&gt; has to be opened with administrative rights:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://uelfla.blu.livefilestore.com/y1pmmsHfeKuEhuqAzbnEmmbdg4I-rYuso2_q_p2_LhGGMHxdTHjj6nzh0O6v5jaZ30fAXSQyQcOfVMd_g25Ue8dlWHNkvdeRN-k/prompt-as-adm.png"&gt;&lt;img src="http://uelfla.blu.livefilestore.com/y1pmmsHfeKuEhuqAzbnEmmbdg4I-rYuso2_q_p2_LhGGMHxdTHjj6nzh0O6v5jaZ30fAXSQyQcOfVMd_g25Ue8dlWHNkvdeRN-k/prompt-as-adm.png" alt="" style="cursor: pointer; width: 329px; height: 400px;" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Since the application trying to run &lt;span style="font-weight: bold;"&gt;stsadm &lt;/span&gt;(the command prompt itself) is running with the "administrative credentials" of your administrator account, the access denied message should go away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8991933975193945258-380006356619613701?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/380006356619613701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/stsadm-access-denied.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/380006356619613701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/380006356619613701'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/stsadm-access-denied.html' title='STSADM: Access Denied'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8991933975193945258.post-4164788781841642721</id><published>2009-09-10T19:57:00.000-03:00</published><updated>2009-10-11T00:55:57.565-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Crystal Reports'/><title type='text'>Could not load file or assembly CrystalDecisions.CrystalReports.Engine</title><content type='html'>If your ASP.NET application does reporting with the Crystal Reports version that comes with Visual  Studio 2008 - Crystal Reports 2008 Basic - when you deploy that application to a fresh IIS installation, you will get the message "&lt;span style="font-style: italic;"&gt;Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0&lt;/span&gt;" etc etc etc. That's because the site needs the Crystal Reports runtime. There's a MSI installation package on machines with VS2008 installed, at &lt;strong&gt;C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5&lt;/strong&gt;. Install the correct MSI (there's one for 32- and another for 64-bit machines), and the application should run ok.&lt;strong&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/8991933975193945258-4164788781841642721?l=gbuchoa2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gbuchoa2.blogspot.com/feeds/4164788781841642721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/could-not-load-file-or-assembly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4164788781841642721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8991933975193945258/posts/default/4164788781841642721'/><link rel='alternate' type='text/html' href='http://gbuchoa2.blogspot.com/2009/09/could-not-load-file-or-assembly.html' title='Could not load file or assembly CrystalDecisions.CrystalReports.Engine'/><author><name>Gilberto Uchôa [GB]</name><uri>http://www.blogger.com/profile/06145937637322510560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_YdLjqqhyG_E/SsF-6da8y5I/AAAAAAAAAAo/4bi3B66DV_w/S220/Untitled+3.jpg'/></author><thr:total>0</thr:total></entry></feed>
