<?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:blogger='http://schemas.google.com/blogger/2008' 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-6359431998918155727</id><updated>2024-08-28T23:01:27.028-05:00</updated><title type='text'>Jerry Young&#39;s Tech Blog</title><subtitle type='html'>.NET, C#, and anything software development.  And maybe a few other interesting things that are not.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>71</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-5418730178304936858</id><published>2017-06-28T17:06:00.000-05:00</published><updated>2017-06-28T17:06:04.613-05:00</updated><title type='text'>Email Approval Considerations</title><content type='html'>Recently wrote a service for handling lazy approvals. &amp;nbsp;IE someone gets an email that they can reply to with an &quot;approved&quot; or &quot;rejected&quot; response and the system uses that to continue its workflow/process.&lt;br /&gt;
&lt;br /&gt;
I can&#39;t share the code for it but wanted to overview some of the challenges/considerations I ran into in case anyone is looking to write their own.&lt;br /&gt;
&lt;br /&gt;
1. &amp;nbsp;Validation: &amp;nbsp;I originally added a custom MessageId into the emails that I logged along with the recipient address so I could validate an email response was &quot;valid&quot;. &amp;nbsp;However, replying to a message generates a new MessageId and the original wasn&#39;t available to me in the 3rd party IMAP library I used.&lt;br /&gt;
&lt;br /&gt;
2. Parsing: &amp;nbsp;When trying to determine what request the email approval was in reference to there is parsing involved. &amp;nbsp;This can get tricky if the email has been forwarded, replied to several times, or the subject altered. &amp;nbsp;I found in one case when testing a peer replied and their web-based email client put some unexpected formatting into the message. &amp;nbsp;A good solution is to use TDD (test driven design) and build some good tests to validate these scenarios as they arise.&lt;br /&gt;
&lt;br /&gt;
3. Responses: To allow for some flexibility I had to create a dictionary of words/phrases that tied back to the response I was expecting. &amp;nbsp;IE &quot;approved&quot; would be considered approved if the response was &quot;yes&quot; or &quot;affirmative&quot;.&lt;br /&gt;
&lt;br /&gt;
4. Approval process workflow: &amp;nbsp;What happens when you reply approved but quickly change your mind and reply rejected? &amp;nbsp;Does the last response become valid? &amp;nbsp;Is the 1st response valid? &amp;nbsp;If the response is invalid do you allow users to reply until a valid response is given?</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/5418730178304936858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2017/06/email-approval-considerations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5418730178304936858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5418730178304936858'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2017/06/email-approval-considerations.html' title='Email Approval Considerations'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-8404229381185887298</id><published>2016-09-19T18:43:00.000-05:00</published><updated>2016-09-19T18:43:01.903-05:00</updated><title type='text'>Deep Object Comparison</title><content type='html'>As I mentioned in my last post you can&#39;t compare reference types using the == operator because it compares the memory addresses not the values. So even with everything being the same two objects will never equal each other.&lt;br /&gt;
&lt;br /&gt;
Below is some sample code that actually does a deep comparison of object to figure out if they are similar or not.&lt;br /&gt;
&lt;br /&gt;
By deep I mean it will recursively follow all enumerations down to their lowest levels and compare them as well.&lt;br /&gt;
&lt;br /&gt;
You might notice that there is no comparison to check the objects are the same type. &amp;nbsp;If you are not familiar with T it is a generic and forces the compiler to ensure objects are of the same type to be passed into this method.&lt;br /&gt;
&lt;br /&gt;
You&#39;ll also notice that values are compared as strings but for my purposes and at least to get you started this is sufficient.&lt;br /&gt;
&lt;br /&gt;
If there was data you wanted to return you could also modify the return type to be a response object with a bool to indicate if objects are the same and a list of which fields differed per your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: xx-small;&quot;&gt;public bool ObjectsAreSame&lt;t&gt;(T a, T b)&lt;/t&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool result = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var t = a.GetType();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var properties = t.GetProperties();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var p in properties)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (typeof(IEnumerable).IsAssignableFrom(p.GetType()) || typeof(IEnumerable&amp;lt;&amp;gt;).IsAssignableFrom(p.GetType()))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ObjectsAreSame(a.GetType().GetProperty(p.Name).GetValue(a, null), b.GetType().GetProperty(p.Name).GetValue(b, null));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (a.GetType().GetProperty(p.Name).GetValue(a, null) != null &amp;amp;&amp;amp; a.GetType().GetProperty(p.Name).GetValue(b, null) != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&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; if ((a.GetType().GetProperty(p.Name).GetValue(a, null).ToString()) != (b.GetType().GetProperty(p.Name).GetValue(b, null).ToString()))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&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; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&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; result = false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&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; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&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; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/8404229381185887298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/09/deep-object-comparison.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/8404229381185887298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/8404229381185887298'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/09/deep-object-comparison.html' title='Deep Object Comparison'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7249383843296222543</id><published>2016-09-15T21:59:00.001-05:00</published><updated>2016-09-15T21:59:07.530-05:00</updated><title type='text'>C# Value vs Reference Types</title><content type='html'>&lt;div&gt;
A refresher for those who may have forgotten about the wild world of value versus reference type.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Assume you have an object as follows:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;public class Person&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;{&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; public string FirstName {get;set;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; public string LastName {get;set;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now assume the following code is executed:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Person a = new Person() { FirstName = &quot;John&quot;, LastName = &quot;Doe&quot;};&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Person b = new Person() { FirstName = &quot;John&quot;, LastName = &quot;Doe&quot;};&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Asset.AreEqual(a,b);&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
This asset will fail. &amp;nbsp;At initial glance you might think &quot;but the values are the same&quot;. &amp;nbsp;Yes, they are. &amp;nbsp;But that is not what is being evaluated! &amp;nbsp;Because a class is a reference type what is being asserted is that the memory location of a is the same as b. &amp;nbsp;In this case, they are not because they are two separate objects.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are several ways to address this. &amp;nbsp;One way would be to override the Equals method on the Person object and do a field by field comparison. &amp;nbsp;Another way might be to override the ToString method which would return a value type that could be compared.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The way I prefer to do this is to create a method that uses reflection (and generics, recursion) thoroughly compare all the object&#39;s fields. &amp;nbsp;This way there is no refactoring if fields are added/removed/changed.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Value types, however, will pass this asset. &amp;nbsp;For example:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;string a = &quot;Hello!&quot;;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;string b = &quot;Hello!&quot;;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Asset.AreEqual(a.b);&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
In this case, we&#39;re not checking the reference but actually comparing the values.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Another interesting thing here that trips people up is if you pass an object by reference then all changes in a method will be reflected in the original object; not so in a value type.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Assume something like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;public void ChangeName(Person aPerson)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;{&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;b&gt;aPerson&lt;/b&gt;&lt;b&gt;.FirstName = &quot;Billy&quot;;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;public void DoSomething()&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;{&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; Person a = new Person() { FirstName = &quot;John&quot;, LastName = &quot;Doe&quot;};&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; ChangeName(a);&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp;Asset.AreEqual(a.FirstName, &quot;Billy&quot;);&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
This will work because ChangeName received the memory reference to a and updated the name. &amp;nbsp;For a reference type, this will not work.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7249383843296222543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/09/c-value-vs-reference-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7249383843296222543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7249383843296222543'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/09/c-value-vs-reference-types.html' title='C# Value vs Reference Types'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-9126545106028518701</id><published>2016-08-23T00:29:00.000-05:00</published><updated>2016-08-23T00:29:05.114-05:00</updated><title type='text'>Entity Framework - Foreign Key Fields</title><content type='html'>Something to keep in mind when working with objects that require a foreign key value; Entity Framework can handle this automatically. &lt;br /&gt;
&lt;br /&gt;
If you have an object that requires a foreign key value you might have found yourself calling SaveChanges to save one object to the database to get its ID so you could insert it into another object.&lt;br /&gt;
&lt;br /&gt;
The better way is to use the ForeignKey property on your corresponding property. &amp;nbsp;The convention is [ForeignKey(&quot;ForeignTableNameHere&quot;)]. &amp;nbsp;You&#39;ll also want to a a public property for the foreign table as well.&lt;br /&gt;
&lt;br /&gt;
Now you can call SaveChanges once at the very end and the foreign key will get set across all the necessary objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/9126545106028518701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/08/entity-framework-foreign-key-fields.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/9126545106028518701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/9126545106028518701'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2016/08/entity-framework-foreign-key-fields.html' title='Entity Framework - Foreign Key Fields'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7434588264479127961</id><published>2015-02-18T11:57:00.002-06:00</published><updated>2015-02-18T11:57:36.032-06:00</updated><title type='text'>OleDB Alternative</title><content type='html'>Had an interesting issue come up using OleDB worth noting...&lt;br /&gt;
&lt;br /&gt;
I was working on a project to import data from a tab delimited file into SQL using SqlBulkCopy. &amp;nbsp;The OleDb file count matched the record inserted file count but comparing the output to the old application with the same data produced different results.&lt;br /&gt;
&lt;br /&gt;
I dropped the file into Excel and it also showed the same results as OleDb. &amp;nbsp;However, when opened in Notepad++ it became apparent that OleDb and Excel (presumably using OleDb to import the file) was merging some of the row data into a description column in the file.&lt;br /&gt;
&lt;br /&gt;
So from all appearances it looked like the process was working but in reality it wasn&#39;t.&lt;br /&gt;
&lt;br /&gt;
The workaround was to replace using OleDb with TextFieldParser. &amp;nbsp;You can find plenty of examples of how this works by searching for it. &amp;nbsp;You will need to add a reference Microsoft.VisualBasic.FileIO which is odd but that&#39;s where they put the TextFieldParser.&lt;br /&gt;
&lt;br /&gt;
Once I implemented this change to read the file into a DataTable the results matched the old application.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7434588264479127961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2015/02/oledb-alternative.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7434588264479127961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7434588264479127961'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2015/02/oledb-alternative.html' title='OleDB Alternative'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-3242605078931839137</id><published>2014-07-11T20:31:00.000-05:00</published><updated>2014-07-11T20:31:03.271-05:00</updated><title type='text'>SharePoint Online Tidbits</title><content type='html'>I&#39;ve been working on a project of late that is using SharePoint Online 2013 as part of the solution. &amp;nbsp;It was not a platform I chose but one that already existed and I was asked to continue building on. &amp;nbsp; For those who might be evaluating a cloud SharePoint solution or those who are just starting to work in it these are my tips, tricks, and tidbits. &amp;nbsp;Please keep in mind this post is specifically about SharePoint Online 2013 and that on premise SharePoint 2013 has differences and limitations that can be overcome.&lt;br /&gt;
&lt;br /&gt;
1. Be aware of the threshold limit. &amp;nbsp;You can&#39;t change this online (you can on premise). &amp;nbsp;If you have any type of data request that has to deal with more than 5,000 records it won&#39;t work.&lt;br /&gt;
&lt;br /&gt;
- If you have 5001 items or more in your &quot;All Items&quot; view; it won&#39;t work.&lt;br /&gt;
- If you need to search that field by a single key with more than 5000 results; it won&#39;t work.&lt;br /&gt;
- Same deal with an API call.&lt;br /&gt;
&lt;br /&gt;
Having said that... Yes... you can have lists with over 5,000 items and still work with them. &amp;nbsp;The big key to this is multiple indexed fields. &amp;nbsp;You can build views that use those multiple indexes and CAML queries via the API as well. &amp;nbsp;A client has 1.5 million rows in several SP Online lists that they&#39;re querying in this manner. &amp;nbsp;Do I recommend it? &amp;nbsp;No. &amp;nbsp;But it is possible.&lt;br /&gt;
&lt;br /&gt;
2. Service durability. &amp;nbsp;I&#39;m not sure how they have the Office 365 cloud setup but our instance constantly has problems. &amp;nbsp;Some days I can&#39;t login to the Office 365 admin site. &amp;nbsp;Some days users can&#39;t save pages with content web parts. &amp;nbsp;Some days something is in extended recovery and other things are slow or quirky. &amp;nbsp;It has caused issues especially at inopportune times.&lt;br /&gt;
&lt;br /&gt;
3. DEV/QA/Prod Environments. &amp;nbsp;Out of the box this concept really doesn&#39;t exist. &amp;nbsp;You can&#39;t really bundle up a site and deploy it to another site. &amp;nbsp;There are really 2 ways to try and do this. &amp;nbsp;One is saving a list or page as a template (with or without content). &amp;nbsp;It works ok in the same site or in a subsite of the site. &amp;nbsp;You can export large amounts of data to Excel and import them into other sites but it doesn&#39;t preserve the meta data. &amp;nbsp;By that I mean Site A might be a drop-down list but Site B that drop-down will be a text box. Not to mention intenal field name issues (see below). You can export an entire site as a template too but it has a 50mb limit.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that SharePoint isn&#39;t really a traditional IT application. &amp;nbsp;In that I mean you don&#39;t have deliverables (EXEs, DLLs, SQL scripts, etc) that you can deploy to various environments. &amp;nbsp;It is really a publishing model. &amp;nbsp;You checkout a page, you save the changes, and when you&#39;re ready for it to go &quot;live&quot; you check it in.&lt;br /&gt;
&lt;br /&gt;
When you want to have a QA team test your solution/changes end-to-end you have a lot of work to build a suitable QA site or even a DEV site. &amp;nbsp;I&#39;ve done it but it is tedious.&lt;br /&gt;
&lt;br /&gt;
4. Scripting is your friend. &amp;nbsp;Angular, KnockOut, JQuery, or plain old JavaScript. &amp;nbsp;Drop them into a Script Editor Web Part and fire away. &amp;nbsp;We used BxSlider, SimpleModal, KnockOut, the SharePoint JS, etc with no issues. &amp;nbsp;We&#39;re also looking at using Bootstrap for responsive UI.&lt;br /&gt;
&lt;br /&gt;
SharePoint Online does NOT want you running resource intensive things on their cloud solution so the more things you push to scripting the happier everyone will be with this solution. &amp;nbsp;See 9/10 for SharePoint/Offsite App tidbits.&lt;br /&gt;
&lt;br /&gt;
5. Internal field names can be an issue. &amp;nbsp;Say I have Site A and I created a List called MyList. &amp;nbsp;And in my list I have firstnnname and Last Name. &amp;nbsp;I realize after I created the list that I misspelled first name and didn&#39;t follow the same convention (spacing and case). &amp;nbsp;I rename &quot;firstnname&quot; to &quot;First Name&quot;. &amp;nbsp;Everything will seem OK until you use an API. &lt;br /&gt;
&lt;br /&gt;
When you use the API two things happen to be aware of...&lt;br /&gt;
&lt;br /&gt;
First, you&#39;ll notice in an API call that there is no &quot;First Name&quot; or &quot;Last Name&quot; field! &amp;nbsp;First Name will appear in the XML as firstnnname. &amp;nbsp;&quot;Last Name&quot; will appear as Last_x0020_Name. &lt;br /&gt;
&lt;br /&gt;
SharePoint will use whatever the original name of the field was. &amp;nbsp;So often times a list will have a &quot;Title&quot; field which will always be Title in the API even if you rename it. &amp;nbsp;And spaces will be replaced by &quot;_x0020_&quot; because is how SP handles spaces.&lt;br /&gt;
&lt;br /&gt;
Oh hey... remember #3 when I talked about Excel exports? &amp;nbsp;That&#39;s the second thing. &amp;nbsp;If you exported this hypothetical MyList via Excel there is no meta data. &amp;nbsp;So when you call the API it WON&#39;T be firstnnname! &amp;nbsp;It will be First_x0020_Name because that is what SharePoint is going to put into the column header which the Import will use to create the column name.&lt;br /&gt;
&lt;br /&gt;
6. The API is useful but it has limitations. &amp;nbsp;I used the SharePoint library and Knockout JS (KO) to query lists and bind them to KO templates. &amp;nbsp;It allowed me to do basically an MVC-eqsue solution inside of SharePoint. &amp;nbsp;However, the API can&#39;t get AD groups and such. &amp;nbsp;It can pull attributes but not groups. &amp;nbsp;My workaround was to create a Script Editor Web Part with a target (advanced -&amp;gt; target audience) of an AD Group that set a variable in JavaScript that I could use to determine which user group had logged in. &amp;nbsp;We only had 1 group that had different content but you could get very complex very quickly with this approach.&lt;br /&gt;
&lt;br /&gt;
I&#39;ll also add that luckily only the pieces applicable to the user are rendered so even if you have a bunch of stuff on a page if you&#39;re using Target Audiences the intended audience will only get the content rendered for them.&lt;br /&gt;
&lt;br /&gt;
7. Targeting individual list items. &amp;nbsp;You can do this with a Content Query Web Part (CQWB). &amp;nbsp;It is smart enough if you go into a list and enable target audiences to return only the items that the logged in user has access to. &amp;nbsp;You CAN&#39;T add a List Web Part that has target audiences set on list items and expect it to work. &amp;nbsp;It will show ALL list items. &lt;br /&gt;
&lt;br /&gt;
I found the CQWP limiting because it offered you 4 fields (title, description, link url, and image url [names might be slightly different]) and basically looked like search results. &amp;nbsp;Apparently you can use CSR (Client-Side Rendering) to doll these up any way you want but my solution didn&#39;t do that because I was doing back-end coding and we didn&#39;t have a UI/UX resource and didn&#39;t know once we got one if he or she would be able to do this.&lt;br /&gt;
&lt;br /&gt;
8. CSS. &amp;nbsp;Good and bad SharePoint has branding/master page/master template type functionality. &amp;nbsp;It is great if you want a consistent look and feel but my team found early on that when we were redoing parts of a site that SharePoint was trumping our CSS. &amp;nbsp;The hack and slash solution is to specify a style element on page elements and style away. &amp;nbsp;The better approach is to make sure your CSS you are referencing has greater specificity than SharePoint. &amp;nbsp;To that end anything we wanted to style had a class name and we styled the class not the HTML elements themselves.&lt;br /&gt;
&lt;br /&gt;
9. Custom SharePoint Apps are a mixed bag. &amp;nbsp;They have some limitations which you can see on the link provided below. &amp;nbsp;I also find them to be a little slow to load and respond. &amp;nbsp;It also stinks that an app will be unavailable while a new build is uploaded. &amp;nbsp;I can edit and save a page in SharePoint with the published version alive and well all day long.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff798382.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ff798382.aspx&lt;/a&gt; &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
10. Cross domain is an option. &amp;nbsp;You can setup a relying party and do stuff with SharePoint Online on premise and IFrame in content. &amp;nbsp;A vendor ran into issues with token lifetime which required you to re-authenticate with ADFS inside the frame.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/3242605078931839137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/07/sharepoint-online-tidbits.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3242605078931839137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3242605078931839137'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/07/sharepoint-online-tidbits.html' title='SharePoint Online Tidbits'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-4597841209527768113</id><published>2014-03-30T16:06:00.000-05:00</published><updated>2014-03-31T16:17:11.134-05:00</updated><title type='text'>IIS and .NET</title><content type='html'>A few things that came up during a deployment that I thought would be worth noting for anyone migrating to a new server...&lt;br /&gt;
&lt;br /&gt;
1. Make sure that the full .NET install is performed.&amp;nbsp; There is a &quot;client&quot; profile which doesn&#39;t include everything and some things are in a different assembly than the &quot;full&quot; framework.&amp;nbsp; You need to specifically target the client framework in your build to use it.&lt;br /&gt;
&lt;br /&gt;
2. The 2.0 and 3.0 frameworks register MIME types and handlers in IIS that you&#39;ll need for ASP.NET and WCF.&amp;nbsp; You can run aspnet_regiis in the 2.0 and 3.0 folders to get this done manually.&amp;nbsp; Your 4.0 framework project will have issues if these things were not done.&lt;br /&gt;
&lt;br /&gt;
-JY</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/4597841209527768113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/03/iis-and-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/4597841209527768113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/4597841209527768113'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/03/iis-and-net.html' title='IIS and .NET'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-8283024017534686927</id><published>2014-02-27T18:39:00.000-06:00</published><updated>2014-02-28T14:54:02.823-06:00</updated><title type='text'>WCF Concurrency and Instances</title><content type='html'>A quick tidbit regarding WCF in terms of performance.&lt;br /&gt;
&lt;br /&gt;
You may be used to using the [ServiceContract] attribute to decorate your WCF method without giving it a second thought.&amp;nbsp; Then as time goes on you may notice that as more users hit your service the performance isn&#39;t what you were expecting.&lt;br /&gt;
&lt;br /&gt;
One of the drawbacks to just using [ServiceContract] is that be default it is to create a new instance of your service which only handles one call.&amp;nbsp; This is fine if you need to do session management but in many cases a REST service will not.&lt;br /&gt;
&lt;br /&gt;
A good practice is to decorate your methods with [ServiceBehavior] which allows you to change how the service operates. By using this behavior and settings the InstanceContextMode to Single you now have a service where all clients calling&amp;nbsp;will use the same instance.&amp;nbsp; So if you are caching data then the performance from that can be realized.&amp;nbsp; In the default mode each client gets its own instance which takes up memory and doesn&#39;t serve anyone except the same caller on sequent calls.&lt;br /&gt;
&lt;br /&gt;
Note: You thread safety becomes important in this case.&lt;br /&gt;
&lt;br /&gt;
You can also change the ConcurrencyMode to determine how a call is handled.&amp;nbsp; In Single mode only one call is handled at a time.&amp;nbsp; So if you had a method that returned a number that is incremented continually, no call would get the same number because each call would wait until previous calls completed.&lt;br /&gt;
&lt;br /&gt;
In a Multiple concurrency mode you would have to wrap the incrementing number with a lock or other thread safe mechanism otherwise you might get a conflict or deadlock because too many operations are trying to perform operations against the simple number field.&lt;br /&gt;
&lt;br /&gt;
There is a 3rd mode called Reentrant which would be a special case that I&#39;ve chosen not to cover here.&lt;br /&gt;
&lt;br /&gt;
So in summary, look at adding the InstanceContextMode and ConcurrencyMode attributes found in the ServiceBehavior attribute instead of just a ServiceContract attribute to better control how your WCF service operates and to tweak performance based on how you need to service to scale/perform.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/8283024017534686927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/wcf-concurrency-and-instances.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/8283024017534686927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/8283024017534686927'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/wcf-concurrency-and-instances.html' title='WCF Concurrency and Instances'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7975069076397510927</id><published>2014-02-12T19:22:00.000-06:00</published><updated>2014-02-12T19:22:00.914-06:00</updated><title type='text'>GAC Priority over Local</title><content type='html'>Something to keep in mind that came up today on a project.&amp;nbsp; If you have a DLL installed in the GAC and the same DLL in the local folder of the application then GAC will take priority.&lt;br /&gt;
&lt;br /&gt;
In the case we ran across today there was a wrapper DLL given to multiple teams and someone installed the DLL in the GAC.&amp;nbsp; There was a bug that was found and updated in the wrapper but&amp;nbsp;the DLL in the GAC wasn&#39;t updated.&lt;br /&gt;
&lt;br /&gt;
This would be a good reason to version your DLL as well.&amp;nbsp; If the version in the GAC doesn&#39;t match the local folder then the local folder would be utilized.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7975069076397510927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/gac-priority-over-local.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7975069076397510927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7975069076397510927'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/gac-priority-over-local.html' title='GAC Priority over Local'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-3902163347173290229</id><published>2014-02-06T06:56:00.000-06:00</published><updated>2014-02-06T10:56:33.894-06:00</updated><title type='text'>SQL Field Encryption</title><content type='html'>If you need to encrypt some data for security in SQL here is how you go about it...&lt;br /&gt;&lt;br /&gt;1. You need to create a master key in your database if one does not already exist&lt;br /&gt;
CREATE MASTER KEY ENCRYPTION BY PASSWORD = &#39;YourPassword&#39;;&lt;br /&gt;&lt;br /&gt;2. Create a certificate.&lt;br /&gt;
CREATE CERTIFICATE YourCertificateName  WITH SUBJECT = &#39;Some Description&#39;;&lt;br /&gt;&lt;br /&gt;3. Create a symmetric key.&lt;br /&gt;
CREATE SYMMETRIC KEY YourKeyName WITH ALGORITHM = DES&lt;br /&gt;ENCRYPTION BY CERTIFICATE YourCertificateName;&lt;br /&gt;&lt;br /&gt;4. To encrypt a field.  Example below will encrypt each YourField column in table YourTable.  NOTE: Be sure to set your encrypted fields to varbinary(128) so you can see the field value.  Otherwise the field may appear blank.&lt;br /&gt;
OPEN SYMMETRIC KEY YourKeyName DECRYPTION BY CERTIFICATE YourCertificateName;&lt;br /&gt;
UPDATE YourTable SET YourField = EncryptByKey(Key_GUID(&#39;YourKeyName&#39;), YourFieldName);&lt;br /&gt;
CLOSE SYMMETRIC KEY YourKeyName;&lt;br /&gt;&lt;br /&gt; 5. To decrypt your field.  This will put the field YourField back to plain text in the output query.&lt;br /&gt;&lt;br /&gt;OPEN SYMMETRIC KEY YourKeyName DECRYPTION BY CERTIFICATE YourCertificateName;&lt;br /&gt; &lt;br /&gt;
SELECT CONVERT(VARCHAR, DecryptByKey(YourField)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS &#39;Decrypted Field&#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM YourTAble;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;CLOSE SYMMETRIC KEY YourKeyName;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/3902163347173290229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/sql-field-encryption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3902163347173290229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3902163347173290229'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/sql-field-encryption.html' title='SQL Field Encryption'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7037972811362121998</id><published>2014-02-05T18:55:00.000-06:00</published><updated>2014-02-05T18:55:00.036-06:00</updated><title type='text'>WHS 2011 Web Access Setup</title><content type='html'>&lt;br /&gt;
In order to be able to access your WHS 2011 server remotely via the web&amp;nbsp;you&#39;ll&amp;nbsp; have a couple of setup steps.&lt;br /&gt;
&lt;br /&gt;
1. Enable Web Access. Open the Dashboard and one of the tasks will be enabling the web access.&amp;nbsp; It will enable it but it may fail due to router settings.&lt;br /&gt;
&lt;br /&gt;
2. Enable port forwarding on your router.&amp;nbsp; Technically, you could DMZ the server but its not secure or the preferred method.&amp;nbsp; Port forwarding is a better option.&amp;nbsp; You&#39;ll want to record the internal IP that your server is on and forward the appropriate ports to your server.&lt;br /&gt;
&lt;br /&gt;
Ports to forward:&lt;br /&gt;
443 is HTTPS which is what the remote access site included with WHS will run under.&lt;br /&gt;
3389 is the RDP port if you want to remotely access your server using Remote Desktop.&lt;br /&gt;
80 is HTTP is you&#39;re going to host a website or something.&lt;br /&gt;
&lt;br /&gt;
There are other ports for mail, ftp, etc if you&#39;re interested in enabling those for your purposes.&lt;br /&gt;
&lt;br /&gt;
If you&#39;re looking for a free solution to access your server with a friendly name rather than the public IP (which can change) I would recommend looking at No-Ip.com.&amp;nbsp; They have an executable that can run as a service to update their DNS when yours changes.&amp;nbsp; So you get a friendly IP even without a static public IP and its free.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7037972811362121998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/whs-2011-web-access-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7037972811362121998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7037972811362121998'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/whs-2011-web-access-setup.html' title='WHS 2011 Web Access Setup'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-974920794613333789</id><published>2014-02-02T22:53:00.001-06:00</published><updated>2014-02-02T22:53:21.761-06:00</updated><title type='text'>Windows Home Server 2011 Client Connector Woes</title><content type='html'>I tried to fire up my original Windows Home Server (WHS) machine but one of the drives was failing and the system wouldn&#39;t boot due to file corruption.&lt;br /&gt;
&lt;br /&gt;
So I built a new box running WHS2011 which I was able to buy for $50 at the local computer parts store. &amp;nbsp;That version is basically a flavor of Windows Server and even has IIS installed so its great for a home development box for whatever projects you have.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, upgrading wasn&#39;t simple. &amp;nbsp;The new connector software complained there was already a version of the connector installed. &amp;nbsp;The version installed didn&#39;t want to uninstall.&lt;br /&gt;
&lt;br /&gt;
I tried to manually delete the files and some registry entries but the new connector still complained. &amp;nbsp;Additionally, it caused my active window to lose focus because an installer was trying to load up constantly.&lt;br /&gt;
&lt;br /&gt;
After a few hours I figured it all out. &amp;nbsp;I went through every entry in the registry with &quot;Windows Home Server&quot; and deleted it. &amp;nbsp;This made the connector installer work, but it would fail part way through and rollback.&lt;br /&gt;
&lt;br /&gt;
I found a Microsoft KB article about a service needing to be enabled and at least set to manual if not started. &amp;nbsp;The name escapes me but it was Media Center related. &amp;nbsp;As it turned out I deleted some registry entries for WHS related to Media Center thinking the new connector install would replace them.&lt;br /&gt;
&lt;br /&gt;
To fix this issue I went to Programs &amp;amp; Features and uninstalled all the &quot;Media Features&quot; which required a reboot then installed them again. &amp;nbsp;Then the new connector installed no problems and everything works great.&lt;br /&gt;
&lt;br /&gt;
Suggestions that might help you circumvent these issues:&lt;br /&gt;
1. Create a restore point on your system and save backups of the registry.&lt;br /&gt;
2. Uninstall the old WHS connector while your old server is still running or before upgrading the software. I think part of the uninstall issue might have been the uninstaller trying to remove the user from the WHS machine and couldn&#39;t because mine was offline.&lt;br /&gt;
3. Try using a different uninstall program like CCleaner.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/974920794613333789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/windows-home-server-2011-client.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/974920794613333789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/974920794613333789'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/02/windows-home-server-2011-client.html' title='Windows Home Server 2011 Client Connector Woes'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-5415886126785341117</id><published>2014-01-15T16:59:00.001-06:00</published><updated>2014-01-15T16:59:16.530-06:00</updated><title type='text'>WCF Service Response Time Slow?</title><content type='html'>Recently ran into an issue testing a WCF web service deployed on a server.&amp;nbsp; A call to a very light service was taking upwards of 15 seconds to return a response.&lt;br /&gt;
&lt;br /&gt;
The service had logging which revealed the call into the service until a response was returned was a fraction of a second.&lt;br /&gt;
&lt;br /&gt;
I decided to do a Fiddler2 trace against a test program to see what was happening and suddenly the service was returning nearly instantly.&amp;nbsp; I continued to test and everything looked fine.&amp;nbsp; I then closed Fiddler2 and then the slow response time returned!&lt;br /&gt;
&lt;br /&gt;
What I ultimately discovered was Fiddler was un-checking the &quot;Automatically Detect Settings&quot; on the Internet Options.&amp;nbsp; This can be found under Control Panel\Network and Internet\Internet Options\Connections\LAN Settings.&amp;nbsp; That setting was apparently set as part of the configuration of my work machine.&amp;nbsp; So that was what was causing the slowness.&lt;br /&gt;
&lt;br /&gt;
I later recalled you can fix this in your WCF bindings by setting useDefaultWebProxy to &quot;false&quot; which ignores this setting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/5415886126785341117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/01/wcf-service-response-time-slow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5415886126785341117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5415886126785341117'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2014/01/wcf-service-response-time-slow.html' title='WCF Service Response Time Slow?'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-9022742280811648477</id><published>2013-12-31T11:23:00.000-06:00</published><updated>2013-12-31T11:23:45.954-06:00</updated><title type='text'>Raspberry Pi -- First Impressions</title><content type='html'>&lt;u&gt;Overview&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
I recently purchased a Raspberry Pi board to play around with its capabilities.&amp;nbsp; I&#39;ve used the Arduino boards before and I think they serve a purpose but I wanted something with a little more horsepower that could run apps as well.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Setup&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
When the Pi arrived I had some initial problems but nothing too major.&amp;nbsp; When I plugged in the Pi nothing happened even with the SD card installed.&amp;nbsp; I was confused on this and there was no clear answers online.&lt;br /&gt;
&lt;br /&gt;
It turns out that the installer I downloaded for Fedora Remix was old and I ended up having to download the new installer and newest builder of Fedora Remix.&amp;nbsp; The newly installed image worked great and the Pi started right up.&lt;br /&gt;
&lt;br /&gt;
I was impressed as well that a Gear Head USB keyboard and a USB mouse I had laying around worked instantly without any setup.&amp;nbsp; It launched me into the GUI (Xfce) and walked me thought some basic install steps.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Impressions&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Running via the GUI is a little sluggish.&amp;nbsp; I found that browsing the web was a little slower than I would have preferred.&amp;nbsp; I&#39;m not sure if overclocking from 700mhz to 1Ghz will make a big difference in that regard or not.&lt;br /&gt;
&lt;br /&gt;
I wanted to see if the Pi could render video and attempted to launch some type of streaming video.&amp;nbsp; Netflix didn&#39;t work through Midori.&amp;nbsp; Amazon wanted to download the Flash player which I started to do but didn&#39;t seem to finish.&amp;nbsp; I will investigate these more.&amp;nbsp; I will also attempt to run YouTue.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Next Steps&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;/u&gt;&lt;br /&gt;
I want to try and get Spotify to stream from the Pi along with testing the GPIO.&amp;nbsp; I&#39;ll see if I can get Netflix or Amazon Instant Video to run and see if it runs well.&amp;nbsp; Eventually as well I want to use this to stream media from other computers in my household.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/9022742280811648477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/12/raspberry-pi-first-impressions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/9022742280811648477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/9022742280811648477'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/12/raspberry-pi-first-impressions.html' title='Raspberry Pi -- First Impressions'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7635202693877848337</id><published>2013-10-25T15:51:00.000-05:00</published><updated>2013-10-25T15:51:35.893-05:00</updated><title type='text'>Card Shuffling</title><content type='html'>I was playing around with building a card game engine and ran across something interesting.&amp;nbsp; My solution as I found all over the internet was to use Random() to generate a random number and use that to &quot;order&quot; the list (array) representing the deck.&lt;br /&gt;
&lt;br /&gt;
My &quot;test&quot; game was basically high card where each player had a deck and drew a card.&amp;nbsp; The person with the highest card won the hand.&amp;nbsp; As I ran the test either Player 1 won or the game was a draw.&amp;nbsp; Player 2 never won.&lt;br /&gt;
&lt;br /&gt;
As it turns out Random is not very good at generating random numbers. It uses a fixed algorithm such that the result are very predictable.&amp;nbsp; Also, it is&amp;nbsp;an expensive operation as it is not very efficient.&lt;br /&gt;
&lt;br /&gt;
A sort is actually a better solution and using sometime to generate random unique values works better.&amp;nbsp; I don&#39;t take credit for this code but here is an example of the better implementation:&lt;br /&gt;
&lt;br /&gt;
var cards = Enumerable.Range(0, 51);&lt;br /&gt;var shuffledcards = cards.OrderBy(a =&amp;gt; Guid.NewGuid());</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7635202693877848337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/10/card-shuffling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7635202693877848337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7635202693877848337'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/10/card-shuffling.html' title='Card Shuffling'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7931830823716797550</id><published>2013-09-23T14:10:00.001-05:00</published><updated>2013-09-23T14:10:45.157-05:00</updated><title type='text'>WebBrowser Control: Password Field Won&#39;t Populate</title><content type='html'>I ran into this issue between version of IE. &amp;nbsp;On IE10 on a password field using the WebBrower&#39;s SetAttribute method works to set the &quot;Value&quot; field of a password field. &amp;nbsp;This does not work on IE 8 or 9. &amp;nbsp;Instead, you have to use the &quot;InnerText&quot; attribute. &amp;nbsp;To make sure 10 still works I have to set both the Value in addition to the InnerText value for the older browsers.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7931830823716797550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/09/webbrowser-control-password-field-wont.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7931830823716797550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7931830823716797550'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/09/webbrowser-control-password-field-wont.html' title='WebBrowser Control: Password Field Won&#39;t Populate'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-5502764966121456002</id><published>2013-01-18T00:24:00.000-06:00</published><updated>2013-01-18T00:24:40.528-06:00</updated><title type='text'>Using Silverlight Toolkits</title><content type='html'>Quick tip: &amp;nbsp;When using the Silverlight Toolkits keep in mind they typically target a specific version of Silverlight.&lt;br /&gt;
&lt;br /&gt;
I recently installed Silverlight 5 and the Silverlight 5 toolkit. &amp;nbsp;I added a reference to a v5 component and it appeared in my designer but my code behind gave an error it couldn&#39;t find the reference to the control.&lt;br /&gt;
&lt;br /&gt;
As it turns out someone else on my team using TFS didn&#39;t have Silverlight 5 installed (only 4) and checked in to TFS with the project target as v4. &amp;nbsp;Switching it back to v5 fixed the issue.&lt;br /&gt;
&lt;br /&gt;
So be sure to check the target version if you&#39;re having trouble with a control from one of the toolkits!</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/5502764966121456002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/01/using-silverlight-toolkits.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5502764966121456002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5502764966121456002'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2013/01/using-silverlight-toolkits.html' title='Using Silverlight Toolkits'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-6326351691677909112</id><published>2012-12-05T10:56:00.001-06:00</published><updated>2012-12-05T10:58:16.434-06:00</updated><title type='text'>Silverlight initalization error</title><content type='html'>So I was copying and pasting some classes into my Silverlight project and when I ran it gave me a pop-up window saying it couldn&#39;t initialize the Silverlight app.&lt;br /&gt;
&lt;br /&gt;
A cursory look revealed that I had accidentally deleted the &quot;ClientBin&quot; folder from my Silverlight web project (remember that there is the client piece and the web piece on SL apps). &amp;nbsp;I added the folder back but the XAP file wasn&#39;t there!&lt;br /&gt;
&lt;br /&gt;
I did a search and didn&#39;t find the solution for this but I figured it out so I wanted to make it available.&lt;br /&gt;
&lt;br /&gt;
You&#39;ll need to go into the project properties (right click on the .WEB project and choose properties). &amp;nbsp;Under the Silverlight Applications tab you will need to add the application.&lt;br /&gt;
&lt;br /&gt;
Click &quot;Add&quot; then choose &quot;use an existing Silverlight project in the solution&quot; and add the SL project into the project.&lt;br /&gt;
&lt;br /&gt;
As part of this it will also recreate the ASPX and HTML page(s) if you accidentally deleted those as well.&lt;br /&gt;
&lt;br /&gt;
The exact message from the browser is: &quot;Error: Unhandled Error in Silverlight Application&lt;br /&gt;
Code: 2104 &amp;nbsp; &amp;nbsp;&amp;nbsp;Category: InitializeError &amp;nbsp;Message: Could not download the Silverlight application. Check web server settings&quot;.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/6326351691677909112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/12/silverlight-initalization-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/6326351691677909112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/6326351691677909112'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/12/silverlight-initalization-error.html' title='Silverlight initalization error'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-5376452484848508334</id><published>2012-11-28T16:52:00.001-06:00</published><updated>2012-11-28T16:52:28.631-06:00</updated><title type='text'>Silverlight Binding Error</title><content type='html'>I ran into an error in Silverlight (v4) today and thought I might take a moment to document the problem in case anyone runs across the same issue.&lt;br /&gt;
&lt;br /&gt;
I created a data grid and was assigning the columns manually. &amp;nbsp;I decided to leave one column without a binding because it will be a combo box field and I wasn&#39;t ready to tackle that yet.&lt;br /&gt;
&lt;br /&gt;
When I ran my app I received and error when I bound my objects to the grid. &amp;nbsp;Since this is just a sandbox proof-of-concept thing I didn&#39;t have it wrapped with a try...catch so it actually came up as an unhandled exception in Internet Explorer.&lt;br /&gt;
&lt;br /&gt;
The error will be &quot;Value cannot be null.&quot; &amp;nbsp;And you might drill down and find an error about an unexpected value as well.&lt;br /&gt;
&lt;br /&gt;
The problem is that you have a field without a binding. &amp;nbsp;So I removed this field (you may opt to add a binding to it) and problem solved.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/5376452484848508334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/11/silverlight-binding-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5376452484848508334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5376452484848508334'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/11/silverlight-binding-error.html' title='Silverlight Binding Error'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-5572126252708250568</id><published>2012-09-25T12:40:00.001-05:00</published><updated>2012-09-25T12:40:29.607-05:00</updated><title type='text'>Unable to install or run the application. The application requires... </title><content type='html'>Ran into an error today doing a Click Once style deployment on my new PC. &amp;nbsp;The end-user was getting an error &quot;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&quot;Unable to install or run the application. The application requires&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&amp;nbsp;...&quot; which proceeds to list the missing DLL and that it needs to be installed in the GAC.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;I checked the reference and &quot;Copy Local&quot; was set to true so I knew the DLL was in the directory when the app runs locally but I found out that Click Once has a way of managing its dependency files.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;When you right click on the project it brings up the project properties window. &amp;nbsp;In VS2010 under the &quot;Publish&quot; tab there is an &quot;Application Files&quot; button. &amp;nbsp;When you click this button it lists all the assemblies and gives you the option under the &quot;Publish Status&quot; column to choose if you want to include these files automatically in the deployment.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;If you set to &quot;Include&quot; then its there but if its set to &quot;Prerequisite&quot; it will want that file to be installed on the machine prior to running the Click Once. &amp;nbsp;Exclude is also an option but I don&#39;t think it does the prerequisite check.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/5572126252708250568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/09/unable-to-install-or-run-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5572126252708250568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/5572126252708250568'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/09/unable-to-install-or-run-application.html' title='Unable to install or run the application. The application requires... '/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-3520059471327883594</id><published>2012-05-02T17:16:00.000-05:00</published><updated>2012-05-02T17:16:38.482-05:00</updated><title type='text'>Detecting Version in C# / .NET</title><content type='html'>I&#39;ve found occasion recently to know the version of Windows that a person is using in order to make a call to the correct API. &amp;nbsp;Mainly, this has been a concern with clients using Windows XP and now moving onto Windows 7 and finding compatibility issues with 3rd party components.&lt;br /&gt;
&lt;br /&gt;
By using&amp;nbsp;System.Environment.OSVersion.Version we can look at the version of Windows running and determine the best source of action. &amp;nbsp;The two properties we are concerned with are &quot;Major&quot; and &quot;Minor&quot;.&lt;br /&gt;
&lt;br /&gt;
You can find a complete list by searching for &quot;System.Environment.OSVersion.Version&quot; but basically, here is the rundown:&lt;br /&gt;
&lt;br /&gt;
Major 5 will be 2000, XP, or 2003. &amp;nbsp;You can tell by the minor version which one it is. &amp;nbsp;Window 2000 is 0, XP is 1, and 2003 is 2.&lt;br /&gt;
&lt;br /&gt;
Major 6 will be Vista, 2008, or 7. &amp;nbsp;Minor 0 is Vista, 2008 is 1, and Windows 7 is 2.&lt;br /&gt;
&lt;br /&gt;
There is also a &quot;Platform&quot; property that will tell you if the machine is running Windows or Unix or WinCE, etc. &amp;nbsp;Since I know my client is running Windows XP or 7 ... &amp;nbsp;I don&#39;t concern my self with that but you might need to.&lt;br /&gt;
&lt;br /&gt;
So a quick example... maybe I need to load a different form with a Windows XP or Windows 7 specific control. &amp;nbsp;I could do something like this:&lt;br /&gt;
&lt;br /&gt;
If (System.Environment.OSVersion.Version.Major == 6)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;//We&#39;re running Vista, 2008, or 7&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;//Load a form with the Windows 7 component&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;//We&#39;re running 2000, XP, or 2003. &amp;nbsp;Hopefully not still on NT or older!!!&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;//Load a form with old Windows components&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/3520059471327883594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/05/detecting-version-in-c-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3520059471327883594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/3520059471327883594'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/05/detecting-version-in-c-net.html' title='Detecting Version in C# / .NET'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-4318077554344424292</id><published>2012-02-23T23:07:00.000-06:00</published><updated>2012-02-23T23:07:30.651-06:00</updated><title type='text'>Database Connectivity in .NET</title><content type='html'>Something to keep in mind about database connectivity in .NET is to always ensure your connection is being disposed of properly.&lt;br /&gt;
&lt;br /&gt;
Many times as developers we code according to the &quot;happy path&quot; which can lead to some undesirable behaviors when an unhappy path occurs.&lt;br /&gt;
&lt;br /&gt;
Here is a quick example (excuse any typos as I&#39;m doing this from memory):&lt;br /&gt;
&lt;br /&gt;
SqlConnection cnn = new SqlConnection(myConnectionString);&lt;br /&gt;
cnn.Open();&lt;br /&gt;
SqlDataReader reader = cnn.ExecuteReader(someQueryOrCommand);&lt;br /&gt;
cnn.Close();&lt;br /&gt;
&lt;br /&gt;
We open a connection, get some data, and we close the connection. &amp;nbsp;Easy, right? &amp;nbsp;Probably works 99% of the time with no problems.&lt;br /&gt;
&lt;br /&gt;
What happens if we timeout during the execution of our SQL query or command? &amp;nbsp;Most of us are/should be using a try...catch block to catch that exception and deal with that error instead of having the app crash due to an un-handled exception.&lt;br /&gt;
&lt;br /&gt;
A potentially big problem exists regardless of the try...catch block. &amp;nbsp;Each time this code is executed and fails for whatever reason we are leaving an orphaned connection. &amp;nbsp;If this happens enough times, we run out of available connections on the server and SQL is not responsive.&lt;br /&gt;
&lt;br /&gt;
Commonly I see this problem when the database is performing slowly and causing a lot of database calls to timeout. &amp;nbsp;A user may repeatedly retry a piece of functionality or may repeatedly close and re-open the application trying to get it to run. &amp;nbsp;These orphan connections typically make the problem worse to the point that the server has to be rebooted.&lt;br /&gt;
&lt;br /&gt;
A good way to handle/prevent trashing your available connection is by using a &quot;finally&quot; block in addition to the try...catch.&lt;br /&gt;
&lt;br /&gt;
The finally block will execute regardless if the outcome of the code (IE, regardless if it goes through the try code with no problems or it hits the exception code block).&lt;br /&gt;
&lt;br /&gt;
Pseudocode for this solution looks like this:&lt;br /&gt;
&lt;br /&gt;
SqlConnection cnn = null;&lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
cnn = new SqlConnection(myConnectionString);&lt;br /&gt;
cnn.Open();&lt;br /&gt;
SqlDataReader reader = cnn.ExecuteReader(someQueryOrCommand);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
catch (Exception ex)&lt;br /&gt;
{&lt;br /&gt;
// do something here&lt;br /&gt;
}&lt;br /&gt;
finally&lt;br /&gt;
{&lt;br /&gt;
if (cnn != null &amp;amp;&amp;amp; cnn.State == ConnectionState.Open)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cnn.Close();&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/4318077554344424292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/02/database-connectivity-in-net.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/4318077554344424292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/4318077554344424292'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/02/database-connectivity-in-net.html' title='Database Connectivity in .NET'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-1782094862667310384</id><published>2012-02-16T13:00:00.000-06:00</published><updated>2012-02-16T13:00:09.836-06:00</updated><title type='text'>Missing .NET Functionality</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;Something I&#39;ve noticed recently in .NET4 is that certain functionality doesn&#39;t seem to be available.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Consider the following line:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;string&amp;nbsp;value&amp;nbsp;=&amp;nbsp;ConfigurationSettings.AppSettings[&quot;somevalue&quot;];
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;I get a warning in the compiler &quot;&lt;span style=&quot;background-color: transparent;&quot;&gt;Warning &#39;System.Configuration.ConfigurationSettings.AppSettings&#39; is obsolete: &quot;This method is obsolete, it has&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;been replaced by&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;System.Configuration!System.Configuration.ConfigurationManager.AppSettings&quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;However, when I type ConfigurationManager, nothing shows up in Intellisense!&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The solution to this is to go to &quot;Add reference&quot; and add the reference to &quot;System.Configuration&quot; in your solution.  Now, that functionality is available.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This is also the case for the &quot;HttpWebRequest&quot; object location in System.Web.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;I&#39;m not sure why 4.0 requires this whereas it just worked in older versions of .NET but it is what it is.&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/1782094862667310384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/02/missing-net-functionality.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/1782094862667310384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/1782094862667310384'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2012/02/missing-net-functionality.html' title='Missing .NET Functionality'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-1094599464076683268</id><published>2011-11-18T09:29:00.001-06:00</published><updated>2011-11-18T12:52:25.516-06:00</updated><title type='text'>The Power of (Kindle) Fire</title><content type='html'>I may do a video review of the Fire at some point because I&#39;m tired of silly unboxing videos and people fumbling through the Kindle Fire UI making stupid comments.  But for now ... here is my article on the Fire as requested by some friends of mine.&lt;br /&gt;
&lt;br /&gt;
First off let&#39;s clear some things up.  This device has been dubbed an iPad killer.  In some ways (which we will discuss) it could be but in other ways its not.  The truth is one is chicken and the other is beef.  Some people prefer one, some people prefer the other.  And hey, some people might prefer pork of seafood.  [Man, I&#39;m getting hungry.]  No the Fire doesn&#39;t have a camera, 3G, microphone, GPS, or a pretentious price tag.  It is a $199 device and an iPad is a $600 device.  Personally, I think its a smart move too.&lt;br /&gt;
&lt;br /&gt;
Your smart phone will have all the features I mentioned and already has a data plan attached to it.  So for someone like me who is a &quot;bang for the buck&quot; individual I don&#39;t want to pay for duplicate features and a second data plan.  For some people this won&#39;t be an issue or concern.  Great! That&#39;s fine.&lt;br /&gt;
&lt;br /&gt;
So what is the Kindle Fire?  Its a device to consume Amazon content (magazines, books, music, movies, tv shows, etc), run apps, and do some web browsing.  In that regard (except for using iTunes content) it sounds just like an iPad at 1/3 the cost.  &lt;br /&gt;
&lt;br /&gt;
What do I like about the Fire?  It is not too bulky so you can use it with one hand.  Content can be stored in the Cloud or on the device.  Purchasing content is easy and there is good integration between the Amazon site on your PC and the Kindle device.  For example, if I purchase content on Amazon it will be available on the Kindle to download or view.&lt;br /&gt;
&lt;br /&gt;
What don&#39;t I like about the Fire? The &quot;8GB&quot; storage is actually closer to 6.5 with everything that is pre-loaded.  Since you can store content on the Cloud that&#39;s not too big of a deal but if you&#39;re trying to load up on movies (less of an issue with books or music) then you might not have enough space.  Allegedly you can store about 10 movies on the Kindle Fire.  The plus side of this is that if you&#39;re connected to wireless you can pull content from your private cloud storage or stream movies.&lt;br /&gt;
&lt;br /&gt;
What do I like about the Amazon content?  The selection is there.  Most new media is available for download.  The pricing is slightly better (say $15 for a new popular movie) vs $20 for the physical media.  There is also rental options that make content available for $1.99 - $5.99.  Most TV shows are about $1.99 for an episode or the season can be purchased.&lt;br /&gt;
&lt;br /&gt;
Music prices seem to be fairly consistent about $0.99 a song but album prices can vary.  Obviously book prices vary along with magazine subscriptions.&lt;br /&gt;
&lt;br /&gt;
With Prime you get free streaming of videos and some limited &quot;loaner book&quot; selections.  The content isn&#39;t necessarily newer stuff but its not all junk.  Where it really shines is the amount of kid friendly content (Sesame Street, etc).&lt;br /&gt;
&lt;br /&gt;
What do I dislike about the Amazon content?  I&#39;d prefer newer content over quantity of content for the Prime stuff.  As far as I know there is no &quot;add-on&quot; to download music for a flat rate like Zune Pass or others.  Some of the content (like Amazon&#39;s audio books; Audibles) doesn&#39;t seem well integrated with Fire yet.&lt;br /&gt;
&lt;br /&gt;
Apps are lacking as well.  I can get some of the more popular apps (Angry Birds, Facebook, Pandora, etc) on my device but ones like ESPN Fantasy Football don&#39;t appear to exist.&lt;br /&gt;
&lt;br /&gt;
Amazon Prime?  For $80/yr which includes free 2-day shipping on Amazon orders I think Prime is one of the better deals going on.  That is basically $6.66 (nice) per month and includes not only streaming content but the loaner books (1 per month).  So better deal than Netflix, etc.&lt;br /&gt;
&lt;br /&gt;
Is this device good for kids?  Yes, if supervised.  There is no filtering/parental controls for web browsing or content downloads.  And since even free content requires having all your billing stuff setup there isn&#39;t much to prevent your child from running up a huge bill on content.&lt;br /&gt;
&lt;br /&gt;
In the first night of using the Fire and trying to get my kid to bed I was able to read her several children&#39;s books and stream episodes of Sesame Street.  The finale I bought Kung Fu Panda ($6.99) and was able to stream it instantly.  I later downloaded it so we can watch it on the go.&lt;br /&gt;
&lt;br /&gt;
Other thoughts?  Kindle doesn&#39;t have much in the way of inputs.  It has a mini stereo jack and a power plug.  The included power cable is a wall cable so I&#39;m not sure if you had a USB cable with the correct connector if you could access the Fire or not.  (IE as a mounted drive.)&lt;br /&gt;
&lt;br /&gt;
Since you&#39;re purchasing digital content (not tied to a device) it seems like you could watch the same content on a computer or connect a computer to your TV and watch it that way.  That seems pretty neat to me because now you&#39;re not having to re-purchase media.&lt;br /&gt;
&lt;br /&gt;
Again, no SD ports or anything but you can upload content on the Amazon site to their cloud so that is handy.  I think you can even upload non-Amazon music content as well.&lt;br /&gt;
&lt;br /&gt;
Web browsing experience is closer to PC than Smart Phones are.  Wasn&#39;t overly fast but wasn&#39;t overly slow either.&lt;br /&gt;
&lt;br /&gt;
Final verdict:  Great device if you have modest needs and the price is very reasonable.</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/1094599464076683268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2011/11/power-of-kindle-fire.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/1094599464076683268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/1094599464076683268'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2011/11/power-of-kindle-fire.html' title='The Power of (Kindle) Fire'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6359431998918155727.post-7228696018051103252</id><published>2011-08-26T16:48:00.000-05:00</published><updated>2011-08-26T16:48:15.405-05:00</updated><title type='text'>The type initializer for ... threw an exception</title><content type='html'>I was given some old code that I needed to port/partially rewrite. &amp;nbsp;The code had some funky things like a class trying to reference a static class as its base (which C# doesn&#39;t allow). &amp;nbsp;My guess is someone started to rewrite the code before they checked it into source control and never completed it.&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Anyhow, I wrote a test app for this code after making a few tweaks and when this particular object was initialized it hit the declaration for the constructor and quit. &amp;nbsp;For some reason, .NET didn&#39;t throw any exceptions; it just stopped executing the code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I wrapped my call with a try catch and caught the following: &quot;The type initializer for &#39;NameOfClassICalled&#39; threw an exception&quot;. &amp;nbsp;[This was a&amp;nbsp;TypeInitializationException.]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;After carefully stepping through the code I found my simple yet elusive mistake. &amp;nbsp;The code was initializing the base class which has static methods it was trying to load. &amp;nbsp;These static methods used the ConfigurationManager which uses the App.config... which I failed to include in my project.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Adding my app.config with the proper entries and I was off to the cases. &amp;nbsp;&lt;u style=&quot;font-weight: bold;&quot;&gt;Reminder:&lt;/u&gt;&amp;nbsp; The parent assemblies config is the one that is used by assemblies called during execution.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jerryyoungstechblog.blogspot.com/feeds/7228696018051103252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2011/08/type-initializer-for-threw-exception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7228696018051103252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6359431998918155727/posts/default/7228696018051103252'/><link rel='alternate' type='text/html' href='http://jerryyoungstechblog.blogspot.com/2011/08/type-initializer-for-threw-exception.html' title='The type initializer for ... threw an exception'/><author><name>Jerry Young</name><uri>http://www.blogger.com/profile/01569800602597799493</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx4M4dE823DtErZZt4M7StHabC71-dpwirryoaxsyne62AP569Y8JC0gZwVdqinRC0z2H1kFlz-GIklwZoBd6eArr1zDT-NWczNneYcNMkmvdngnk9o-_wtxWjMlY8png/s220/11264916_10204415433842021_7921769341307911808_n.jpg'/></author><thr:total>0</thr:total></entry></feed>