<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Tony Newling's Experiments with .NET</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/tonynewling/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/tonynewling/feed.xml</link>
    <description>Describe&amp;#039;s my experiences building a club management application for the web, using Visual Studio 2010, ASP.NET 3.5, MVC2, and LINQ to SQL.</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:04:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Next Steps – Windows Phone</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/next-steps-windows-phone</link>
      <pubDate>Tue, 12 Oct 2010 07:57:39 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/10/12/next-steps-windows-phone/</guid>
      <description><![CDATA[It has been a bit quiet here, sorry to disappoint my many avid readers .  The project is built and...]]></description>
      <content:encoded><![CDATA[<p>It has been a bit quiet here, sorry to disappoint my many avid readers <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/38/59/metablogapi/0333.wlEmoticon-smile_1E2EA50A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-38-59-metablogapi/0333.wlEmoticon_2D00_smile_5F00_1E2EA50A.png" />.</p>  <p>The project is built and deployed and in use, and I took my life back for a while and hence haven’t documented everything I would like to.&#160; In particular, my deployment experiences to GoDaddy are worth writing down since I know (from trying to find answers myself on the web) that it isn’t as simple as it could be.&#160; I also “owe” (I think) my authorization architecture since that is another area I have seen people struggling with, particularly when it comes to deploying to a hoster like GoDaddy.&#160; </p>  <p>But all that will have to wait.&#160; I am excited about Windows Phone coming so have decided to build a phone app for our running club.&#160; Truth be told, our club members don’t like sitting in front of computers but they would see utility in being to update club records from a phone, perhaps even at the run each week.&#160; Press gang people into setting runs and commit them on the spot using the phone.</p>  <p>So, I have a pretty well functioning ASP.NET MVC site.&#160; I have controllers and repository code that does a lot of what I need.&#160; Now how to get it on the phone?&#160; The phone apps, of course, are written in Silverlight and so I have to use my web site using some form of services.&#160; I asked around and an architecture of:</p>  <ol>   <li>Add JsonResult actions to my controllers and reuse existing code</li>    <li>Call the JsonResult methods using Http from Silverlight on the phone</li> </ol>  <p>&#160;</p>  <p>The other option is probably ADO data services but that would mean rewriting large chunks of function that is already tested, works, and is secure.</p>  <p>So, I wrote my first simple bit of Json code, as follows:</p>  <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public JsonResult SilvGetNextRun()   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Run r = rr.GetNextRun();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JsonResult j = new JsonResult();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; j.Data = r;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; j.JsonRequestBehavior = JsonRequestBehavior.AllowGet;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return j;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>  <p>but on running it got the dreaded “<i>A circular reference was detected while serializing an object of type ‘blah.blah.blah’.”</i></p>  <p>After a bit of web searching I found <a href="http://www.west-wind.com/WebLog/posts/147218.aspx" target="_blank">this article</a> which explains the problem well; but in short form, LINQ to SQL generates two way references between classes and these can’t be serialized (presumably for data safety).&#160; So now I am trying to work out what to do.&#160; Since I have to build classes for my entities for the phone end of the app, I am thinking of using a “middle tier” object which has no references and can simply be used to serialize and move the data between server and phone.&#160; If anyone has better ideas I am all ears.</p>  <p>There is a moral here somewhere.&#160; I fell in love with LINQ to SQL because it was so easy to use, but as always you need to anticipate your architectural challenges and make sure design choices don’t come back to bite you.</p>]]></content:encoded>
    </item>
    <item>
      <title>New Web Site In Production!</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/new-web-site-in-production</link>
      <pubDate>Thu, 16 Sep 2010 17:41:17 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/09/16/new-web-site-in-production/</guid>
      <description><![CDATA[Two weeks ago I put http://www.singaporeharriets.com into production.&#160; As a hobby programmer I...]]></description>
      <content:encoded><![CDATA[<p>Two weeks ago I put <a href="http://www.singaporeharriets.com">http://www.singaporeharriets.com</a> into production.&#160; As a hobby programmer I didn’t follow a disciplined approach, was skinny on testing, and fixed bugs in production.&#160; I don’t have time to give the details here but will, when I get a chance, talk about some of the issues I had with loading to GoDaddy, even though I had been testing UAT on GoDaddy.&#160; </p>  <p>Anyway, I am loving the new site.&#160; No more manual work updating the site, no deadlines to get run sites updated since every Wednesday night, the site automatically clicks over to the new run site.&#160; The committee of the club are slowly getting on board and soon will be able to manage the site themselves.</p>]]></content:encoded>
    </item>
    <item>
      <title>Musings:  Best Way to Provide an Appropriate View</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/musings-best-way-to-provide-an-appropriate-view</link>
      <pubDate>Sat, 07 Aug 2010 09:28:26 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/08/07/musings-best-way-to-provide-an-appropriate-view/</guid>
      <description><![CDATA[As I have been writing the code and web pages, one dilemma I have come across has been how to...]]></description>
      <content:encoded><![CDATA[<p>As I have been writing the code and web pages, one dilemma I have come across has been how to provide the appropriate view by role.&#160; For example, a member record contains a number of fields (like address) that the member should be allowed to update, while there are other fields (like date of joining) that only committee members should be able to update.&#160; How best to handle this.&#160; There are many options I can see:</p>  <ul>   <li>A different view for each role:&#160; but this adds duplicate code that might need to be maintained.</li>    <li>Controls on what fields can be updated within the controller:&#160; I can’t find this quickly but you can specify which fields can be updated by which roles.&#160; The downside of this is presenting a field a user “thinks” they can edit and then issuing them a validation error message when they can’t, which doesn’t seem appealing to me.</li>    <li>Writing “which user” logic into the view, which is tag soup.&#160; See the example at the bottom for what I mean here.</li> </ul>  <p>I quickly read this article: <a title="http://msdn.microsoft.com/en-us/magazine/dd942822.aspx" href="http://msdn.microsoft.com/en-us/magazine/dd942822.aspx">http://msdn.microsoft.com/en-us/magazine/dd942822.aspx</a> but probably didn’t spend enough time to fully comprehend this.&#160; Right now, my bottom line is that I probably need a comprehensive re-think on my security model, but for now will deploy what I have, even if it isn’t so maintainable.</p>  <h5>Example</h5>  <pre>&lt;tr&gt;<br />&lt;td&gt;Date&lt;/td&gt;<br />&lt;% if (Context.User.IsInRole(&quot;webmaster&quot;)) { %&gt;<br />&lt;td&gt;&lt;%= Html.TextBoxFor(model =&gt; model.Date) %&gt;&lt;%= Html.ValidationMessageFor(model =&gt; model.Date) %&gt;&lt;/td&gt;<br />&lt;% } else { %&gt;<br />&lt;td&gt;&lt;%= Html.Encode(Model.Date) %&gt;&lt;/td&gt;<br />&lt;% } %&gt;<br />&lt;/tr&gt;&#160;&#160; </pre>]]></content:encoded>
    </item>
    <item>
      <title>Calling a Different Controller with Html.ActionLink</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/calling-a-different-controller-with-html-actionlink</link>
      <pubDate>Sat, 07 Aug 2010 09:12:22 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/08/07/calling-a-different-controller-with-html-actionlink/</guid>
      <description><![CDATA[I have been working away on the web site but haven’t had too much time to blog about it.&#160; I...]]></description>
      <content:encoded><![CDATA[<p>I have been working away on the web site but haven’t had too much time to blog about it.&#160; I have a few thoughts and fixes here and there which I do need to record, though.&#160; The first of them is the Html.ActionLink helper.&#160; </p>  <p>My main entities are Members and Runs.&#160; However, the two are linked in a number of ways so it is inevitable that from the context of a Member, I need to update some Run information or vice versa.&#160; For example, in my member transcript page, which records the runs they have done, or are setting, the member is able to update some details about some Runs.&#160; So from a Member view invoked from the Members controller, I want to invoke a method in the Runs controller.&#160; It took me a while to figure out the correct signature for ActionLink, and here it is:</p>  <pre>&lt;%= Html.ActionLink(&quot;Details&quot;, &quot;Details&quot;, &quot;Runs&quot;, new { id = rh.RunNumber }, <strong>null</strong>) %&gt;</pre>

<p></p>
It turns out the null at the end of the signature is important.&#160; The third parameter is the controller I am calling, the second is the method, and the first is of course the link text.&#160; Without the null at the end, this helper generates some bizarre link within the context of the controller that invoked the current view.&#160; I think the documentation needs to be a little more clear.&#160; As usual, I found this fix pretty easily with a web search.

]]></content:encoded>
    </item>
    <item>
      <title>Problem Solved – DropDownList and ViewData</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/problem-solved-dropdownlist-and-viewdata</link>
      <pubDate>Fri, 18 Jun 2010 23:03:36 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/06/18/problem-solved-dropdownlist-and-viewdata/</guid>
      <description><![CDATA[One of the requirements of our application is to simplify data entry and minimize errors.&#160; For...]]></description>
      <content:encoded><![CDATA[<p>One of the requirements of our application is to simplify data entry and minimize errors.&#160; For example, member shirt size should be recorded for when they get an award of a shirt for run milestones.&#160; These sizes should match standards.&#160; Run status should be selected from a dictionary. I don’t really want to keep these dictionaries in the database, so my challenge was to:</p>  <ul>   <li>Build a drop down list of allowed values for create functions.</li>    <li>Use the drop down list in edit functions but set the selected item to whatever is currently in the database.</li> </ul>  <p>Both these took some time to work out.&#160; If you search on ViewData, you will find endless people asking questions because they are having problems.&#160; It took me a while to figure out how to use ViewData, and I think the key for me was understanding that you can put almost anything in ViewData and it will behave like an object that you can extract from.&#160; Naming the ViewData correctly is also important.</p>  <h3>Challenge 1:&#160; Getting ViewData to work</h3>  <p>You know you have a problem if you get debugging messages saying something like one type cannot be converted to another.&#160; So you have to get the types in your ViewData to match the types expected where you will use them.&#160; Duh, seems obvious to say it now, but until you have made a mistake or two even the explanations on the Internet don’t make much sense.&#160; Here is a typical case, let’s look at the HMTL first:</p>  <pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;tr&gt;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&gt;Run Status&lt;/td&gt;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&gt;&lt;%= Html.DropDownList(&quot;RunStatus&quot;) %&gt;&lt;/td&gt;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/tr&gt;</pre>

<p>So I need to populate my drop down list with a stanard list of selectable items.&#160; The code in the controller to do this is:</p>

<pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&lt;SelectListItem&gt; rs = new List&lt;SelectListItem&gt;();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Hare(s) Needed&quot;, Value = &quot;Hare(s) Needed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Run Claimed&quot;, Value = &quot;Run Claimed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Confirmed&quot;, Value = &quot;Confirmed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Completed&quot;, Value = &quot;Completed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs[0].Selected = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ViewData[&quot;RunStatus&quot;] = rs;</pre>

<p>Using SelectListItem is key here, an array of these is what the DropDownList expects.&#160; You will find a ton of articles on the Internet explaining this issue (but not always clearly).</p>

<h3>Challenge 2:&#160; Setting the Selected Value in the DropDownList to Match Database Value</h3>

<p>When editing the run, I want to take whatever is already in the database and make that the selected item in the drop down list.&#160; This is so the user doesn’t make an error when editing a run by accidentally setting the value to whatever is first on the list.&#160; So here is the solution I figured out:</p>

<pre>            Run r = rr.GetRun(id);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int sel = 0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string val = r.RunStatus;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch (val)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;Hare(s) Needed&quot; : sel = 0; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;Run Claimed&quot;: sel = 1; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;Confirmed&quot;: sel = 2; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;Completed&quot;: sel = 3; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; default: sel = 0; break;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (r == null) return View(&quot;NotFound&quot;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // List of Run Status<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&lt;SelectListItem&gt; rs = new List&lt;SelectListItem&gt;();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Hare(s) Needed&quot;, Value = &quot;Hare(s) Needed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Run Claimed&quot;, Value=&quot;Run Claimed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Confirmed&quot;, Value=&quot;Confirmed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs.Add(new SelectListItem() { Text = &quot;Completed&quot;, Value=&quot;Completed&quot; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rs[sel].Selected = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ViewData[&quot;RunStatus&quot;] = rs;<br /> <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return View(&quot;Edit&quot;, r);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</pre>]]></content:encoded>
    </item>
    <item>
      <title>Problems Solved This Week</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/problems-solved-this-week</link>
      <pubDate>Fri, 18 Jun 2010 22:41:23 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/06/18/problems-solved-this-week/</guid>
      <description><![CDATA[I have solved quite a few problems with my application design over the last week, but of course...]]></description>
      <content:encoded><![CDATA[<p>I have solved quite a few problems with my application design over the last week, but of course haven’t had time to blog about them because I have been fixing them.&#160; Anyway, I thought I’d better capture a few while I watch the football.</p>  <p>A quick aside:&#160; it is so much easier being a developer in the Internet age.&#160; I was talking about this today and a few thoughts came to me:</p>  <ol>   <li>Crowd-sourcing – if you have a problem or need help designing a solution to something, just search.&#160; There hasn’t been a single problem I have had to solve in this application that hasn’t had a solution somewhere on the Internet.</li>    <li>On demand learning – there is no longer a need to attend four weeks of classes to be productive.&#160; I think about all the technologies that are new to me in building this app:</li>    </ol><ol>     <li>C# (although I do have a fair bit of hobby and academic experience with C and C++, and a lot of professional experience with Java)</li>      <li>ASP.NET</li>      <li>.NET generally (although I think my experience with Java and WebSphere have helped me in understanding modern application model architectures)</li>      <li>SQL Server (although I did do some Oracle programming at Uni and DB2 programming at IBM).</li>      <li>LINQ to SQL</li>      <li>Visual Studio 2010 (although I find this so intuitive I almost naturally know how to do stuff</li>   </ol>   <blockquote>   <p>I find I can simply do searches on the Internet to find:</p>    <ul>     <li>Programming documentation</li>      <li>Class library documentation</li>      <li>Examples</li>   </ul></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Application “Business” Requirements</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/application-business-requirements</link>
      <pubDate>Fri, 11 Jun 2010 17:35:41 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/06/11/application-business-requirements/</guid>
      <description><![CDATA[I thought I’d better post what I am trying to achieve with this application.  Our running club is a...]]></description>
      <content:encoded><![CDATA[<p>I thought I’d better post what I am trying to achieve with this application.</p>  <p>Our running club is a “Hash House Harriers” club (actually Harriets, because it is a ladies’ club that tolerates men) in Singapore.&#160; The club meets weekly to run “cross country”.&#160; Our runs/walks are best when they are in jungle/forest, but they also incorporate road, trail etc.&#160; After the run the club assembles for drinks at the run site and tells stories about what happened on the run.&#160; The club has an elected committee that is responsible for organizing the activities of the club.&#160; The responsibilities include:</p>  <ul>   <li>Organizing a run for each week.&#160; This involves getting 2-3 members to volunteer to lay out where the run will go.</li>    <li>Notifying members and guests of the run location each week by web site and email.</li>    <li>Keeping a membership list.</li>    <li>Collecting subscriptions and run guest fees and reporting annually on the finances of the club.</li>    <li>Reporting club status to the Registar of Societies in Singapore.</li>    <li>Recording run attendance.&#160; A tradition of our hash is that people are presented with milestone awards, for completing 50, 100, 150 etc runs.&#160; One of our members has completed 1,000 runs (the club has been running since 1973).</li>    <li>Organizing special events, for example anniversaries (we had our 35th Anniversary run in 2008) and milestone runs for the club (run 2,000 will be in October 2011).</li>    <li>Keeping a historical record of the activities of the club.</li> </ul>  <p>The records of the club are kept in Excel spreadsheets – the member’s list, run attendance list, financial records, and the “hareline” or list of upcoming runs and who is organizing them.&#160; These sheets are maintained by different people and they regularly get out of synch.&#160; If a new member joins, the treasurer, secretary, and run organizer all have to remember to update their sheets and in a consistent way.&#160; Of course that doesn’t happen!</p>  <p>My solution to this issue is:</p>  <ol>   <li>Use a central database to keep one copy of the truth for all records.</li>    <li>Allow committee members to update these records through a web interface (and one day, perhaps, through a phone web browser or application from the run site).</li>    <li>Allow members to validate and, in appropriate situations, update their own records (for example change a phone number, or claim credit for a run they attended that was not correctly recorded by the committee).</li> </ol>  <p>The design is probably best represented by the database schema I have developed (more on this later):</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/38/59/metablogapi/3108.image_6C54C74C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-38-59-metablogapi/3108.image_5F00_6C54C74C.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/38/59/metablogapi/5277.image_thumb_464EF129.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-38-59-metablogapi/5277.image_5F00_thumb_5F00_464EF129.png" width="445" height="368" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Early Mistakes:  Not Setting Target Framework Correctly</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/early-mistakes-not-setting-target-framework-correctly</link>
      <pubDate>Fri, 11 Jun 2010 17:10:09 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/06/11/early-mistakes-not-setting-target-framework-correctly/</guid>
      <description><![CDATA[As implied in my introduction, I made a few mistakes early on in my project development.&#160; I am...]]></description>
      <content:encoded><![CDATA[<p>As implied in my introduction, I made a few mistakes early on in my project development.&#160; I am new to Visual Studio and new to .NET, but I jumped in with both feet and used the Visual Studio wizard to build an MVC2 project.&#160; By default it sets the target framework to .NET Framework 4.0.</p>  <p>I happily commenced development using <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-MVC-2.productCd-0470908076,descCd-tableOfContents.html" target="_blank">NerdDinner</a> as the overall architecture template for my application.&#160; I got quite a long way into development when I realized that GoDaddy only supported 3.5, so I went back and modified the target framework to 3.5, but unfortunately I was so far in (having already developed my database schema and LINQ to SQL classes) that everything started going horribly wrong, with error messages on compile like:</p>  <p><font size="1">------ Build started: Project: HarrietsMembers, Configuration: Debug Any CPU ------     <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(33,29): error CS0029: Cannot implicitly convert type 'HarrietsMembers.Models.Member' to 'HarrietsMembers.Member'      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(45,29): error CS0029: Cannot implicitly convert type 'HarrietsMembers.Models.Member' to 'HarrietsMembers.Member'      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(58,29): error CS0029: Cannot implicitly convert type 'HarrietsMembers.Models.Member' to 'HarrietsMembers.Member'      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(65,70): error CS1061: 'HarrietsMembers.Member' does not contain a definition for 'MemberNumber' and no extension method 'MemberNumber' accepting a first argument of type 'HarrietsMembers.Member' could be found (are you missing a using directive or an assembly reference?)      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(69,53): error CS1061: 'HarrietsMembers.Member' does not contain a definition for 'GetRuleViolations' and no extension method 'GetRuleViolations' accepting a first argument of type 'HarrietsMembers.Member' could be found (are you missing a using directive or an assembly reference?)      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(112,29): error CS0029: Cannot implicitly convert type 'HarrietsMembers.Models.Member' to 'HarrietsMembers.Member'      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(122,29): error CS0029: Cannot implicitly convert type 'HarrietsMembers.Models.Member' to 'HarrietsMembers.Member'      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(124,13): error CS1502: The best overloaded method match for 'HarrietsMembers.Models.MemberRepository.Delete(HarrietsMembers.Models.Member)' has some invalid arguments      <br />C:\Local Copies\HarrietsMembers\Controllers\MembersController.cs(124,23): error CS1503: Argument 1: cannot convert from 'HarrietsMembers.Member' to 'HarrietsMembers.Models.Member' </font></p>  <p><font size="1">Compile complete -- 9 errors, 0 warnings     <br />========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========</font></p>  <p>I did some research but couldn’t find anything that would help me resolve these errors, so in the end decided to:</p>  <ol>   <li>Start with a fresh project, and this time set the target framework to 3.5 before doing anything else!</li>    <li>Test deployment of the skeleton application to see if it would work on GoDaddy before doing any more coding (should have done this first, right?).&#160; The MVC sample deployed fine, excepting that I had to include the MVC framework in my application for deployment since they are not installed by default on my hosted server. </li> </ol>]]></content:encoded>
    </item>
    <item>
      <title>Introduction</title>
      <link>https://docs.microsoft.com/archive/blogs/tonynewling/introduction</link>
      <pubDate>Thu, 10 Jun 2010 20:49:54 GMT</pubDate>
      <dc:creator><![CDATA[Tony Newling]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tonynewling/2010/06/10/introduction/</guid>
      <description><![CDATA[Hello, and welcome to my MSDN blog.&#160; I blog in a ton of other places, but I set this blog up...]]></description>
      <content:encoded><![CDATA[<p>Hello, and welcome to my MSDN blog.&#160; I blog in a ton of other places, but I set this blog up specifically to share my experiences building an application from scratch.&#160; What might also be interesting is that I am, at best, a hobby programmer and I have never written a full application on the Microsoft platform before.&#160; </p>  <p>The task:&#160; build a web-based, club management application for my running club, the <a href="http://www.singaporeharriets.com" target="_blank">Singapore Hash House Harriets</a>.&#160; I am the volunteer webmaster for the site which I maintain using Expression Web 3.</p>  <p>Why?&#160; Because club management, scheduling of runs, and communication are all very manual right now, paper based, and subject to error, confusion, and hurt feelings.</p>  <p>The Platform Chosen:&#160; ASP.NET 3.5, MVC2, SQL Server 2005, LINQ to SQL.&#160; The tool of choice is Visual Studio 2010.</p>  <p>Why?&#160; Well, a number of both “business reasons” and my own preferences:</p>  <ol>   <li>We selected GoDaddy as our web hosting platform this year and 3.5 and SQL 2005 is all they offer.</li>    <li>I want to learn the Microsoft platform better.</li>    <li>I liked the look of MVC2 and wanted to see how “easy” or “hard” it was for an amateur to program in it.</li>    <li><a href="http://weblogs.asp.net/scottgu/pages/nerddinner.aspx" target="_blank">NerdDinner</a> had a lot of the characteristics I needed at first glance and NerdDinner was written in MVC2 with .NET 4.0.&#160; I took a risk that I would be able to get the function to work on 3.5 and so far, that risk has worked out.</li> </ol>  <p>This blog will look a little backwards in time because started work about one month ago and I already have some core function written and am getting close to deploying a UAT version.&#160; So I need to share some of the experiences I had and mistakes I made along the way.</p>  <p>Comments are very welcome, particularly suggestions for improvements to my approach and better ways of doing things.</p>]]></content:encoded>
    </item>
  </channel>
</rss>