Coming to a User Group near you….

BronwenWeeGo.jpgAs some of you may have already seen on Brian’s blog, I’ve been oranising a roadtrip of some of the SQL User Groups for us to do a presentation on SQL Spatial.

So far I’ve lined up the following dates/locations:

  • 9 January – Canberra
  • 10 January – Adelaide
  • 12 February – Sydney
  • 14 February – Perth

So watch this space and we’ll post more details once we think of a catchy title for the presentation.  Also any suggestions for content you’d like covered is always appreciated.

Having never been to either Adelaide of Perth..some suggestions of some scenic photo taking spots would be good too 🙂

 

Printing your Virtual Earth Map

johnWeeGo.jpgI have posted up the unsupported code to allow support for printing a Virtual Earth Map in IE6, IE7 and Firefox:

http://www.viawindowslive.com/Articles/VirtualEarth/PrintinginVirtualEarth.aspx

There are two versions of the code, a compiled ready to use version and a full source code version. Importantly if you don’t need to support tile layers then it is a simple javascript file you need to use in your project.

 Do keep in mind this isn’t supported but for those people who need to provide printing functionality today this will help you significantly.

John.

SQL 2008 Spatial Webcast today at 9am PDT

johnWeeGo.jpgIsaac just posted he is presenting an hour session on SQL 2008 spatial today (1st Nov) at 9am PDT. You can register here:

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032353122&Culture=en-US

From the event blurb:

Event Overview

Microsoft SQL Server 2008 delivers new spatial data types that enable you to consume, use, and extend location-based data through spatial-enabled applications. Attend this webcast to learn how to use spatial functionality in next version of SQL Server to build and optimize spatial queries.

Presenters: Isaac Kunen, Program Manager, Microsoft Corporation, and Michael Rys, Principal Program Manager, Microsoft Corporation

Language(s):
English.

Product(s):
SQL Server.
Audience(s):
Developer.

Duration:
60 Minutes
Start Date:
Thursday, November 01, 2007 9:00 AM Pacific Time (US & Canada)

New Article – Your video to Silverlight Streaming 102 – With Expression Encoder plugin

BronwenWeeGo.jpgI’d read about 3 blogs today about the new Expression Encoder plugin for Silverlight Streaming.  It all looked pretty cool as the old manual manipulation of files, zipping and uploading wasn’t overly user friendly.  So I had a play and it’s a great improvement.

So I’ve created a new article: Your video to Silverlight Streaming 102 – With Expression Encoder Plugin.

It is a follow up from Your video to Silverlight Streaming 101. It gives a simple introduction to Silverlight Streaming that will allow you to turn your own video content into a Silverlight Streaming application ready for you to place on your website or blog using Silverlight Streaming plug-in for Expression Encoder to publish to your Silverlight Streaming account.


kick it on DotNetKicks.com

Virtual Earth beta exam completed

johnWeeGo.jpgI sat down and completed the Beta exam for Virtual Earth this week. Clearly I’m not allowed to elaborate on the questions but I’d like to share my thoughts and experience.

The exam was scheduled for 4 hours, 3hours for the exam, 30 min for comments. I completed it in about 2 hours, leaving a dozen or so comments.

The format was quite good, the exam is completely automated running in the standard test suit. It featured multiple choice questions, some with one selection, some with multiple. I quite liked the concept of choosing and arranging pseudo code, top marks for those questions.

I’m not a big fan of memorising code, I work with a copy of the API documentation open, with no intellisence for Virtual Earth JavaScript in Visual Studio I find copy and paste very effective. I have to say that I do know most of the functions by heart and although the questions are multiple choice they are providing options that could very well be valid, again I can’t be specific but on occasion it comes down to a 50:50 guess unless you really knew the method to every parameter.

The breadth of coverage of Virtual Earth is pretty comprehensive, I’m lucky in that I have played with almost all aspects either commercially or while helping someone so know it all pretty well. I think someone who has just built a few applications would struggle, for example you may never have used the routing functionality.

The exam also covers Map Point Web Service (MWS) pretty heavily. I understand there are features that compliment VE in the service. My tip is to learn that API focusing on the areas that compliment Virtual Earth, again no details from me.

To give you an idea I answer many questions on the MSDN VE forums and have worked commercially with VE now for 18 months non-stop. I have used MWS for geocoding and reverse geocoding. I didn’t study. Of the 70 questions I noted 24 I wasn’t 100% certain on. That is either it came down to two and was a 50:50 guess or I wasn’t confident I knew the syntax exactly.

So with any luck I’ll get around the 80% mark but I have to wait 8 weeks to find out. Now I have said that I’ll probably fail and wonder why I blogged at all

Anyway if your keen about Virtual Earth you should book an exam, do some study and sit the test. John.

Missing a “:” in your syndicated feeds in DNN 4.6?

BronwenWeeGo.jpgAfter launching GeekGirlBlogs the other day I soon came across a problem with any syndicated feed.  It would attach www.geekgirlblogs.comhttp to the front of all the links.

I had lots of things it could have been..

  • DNN 4.6
  • Use of FriendlyURLs
  • having a proper domain in front

So i got it back onto my local environment and started removing bits.  Eventually I discovered it was the fact i was using geekgirlblogs.com instead of www.geekgirlblogs.com for portal alias of the site.

So as soon as if changed the alias to the www version tada..the rss was working again.  Pity it took me so long to try that!

ViaWindowsLive Update

BronwenWeeGo.jpgIt’s been awhile since i did an update on ViaWindowsLive.  Thought I do some stats…Virtual Earth is still very popular, but we are getting interest in silverlight streaming, custom domains, liveid and spaces.

Top Content

  1. http://www.viawindowslive.com/
  2. www.viawindowslive.com/VirtualEarth.aspx
  3. www.viawindowslive.com/Messenger.aspx
  4. www.viawindowslive.com/SilverlightStreaming.aspx
  5. www.viawindowslive.com/Blog.aspx

Top Articles

  1. Whats new in Virtual Earth 6
  2. Your video to Silverlight Streaming 101
  3. Getting Started with Virtual Earth Version 6
  4. Setting up Windows Live Custom Domains for your Email
  5. Loading Custom Icons using a GeoRSS Feed (V5)

Top Resources

  1. Virtual Earth Location Finder
  2. The Virtual Earth Quick Guide
  3. Virtual Earth Resouces
  4. Silverlight Streaming Resources
  5. Alerts Resources

 

Top Traffic Sources

  1. http://www.google.com/
  2. forums.microsoft.com
  3. blogs.msdn.com
  4. http://www.live.com/
  5. laboratorie-microsoft.org

Top Keyword searches

  1. silverlight streaming account
  2. livespaces
  3. via windows live
  4. live id
  5. virtual earth

Visito Countires

  1. United States
  2. Australia
  3. United Kingdom
  4. France
  5. India

WPF ClickOnce – Can i have my cake and eat it too?

BronwenWeeGo.jpgI want my cake and be able to eat it too..can anybody help me?

My scenario..I’ve got a WPF application that i want to install and pass a parameter to put into the installing user’s configuration file and i want to use a single link from a web page.

At the moment I have 2 options:

The Install Link: which will call setup.exe on the application package.  It checks and installs the necessary prereqs and then the application.

The Launch link – it installs the application without checking for prereqs.

So you’re saying..go with the install link right? Well the launch link allows me to specific a parameter on the query string e.g. ?Username=Bob which then puts that in the appropriate place in the user’s config file on install.  I can’t find a way to do this using the install link 🙁

How can I check prereqs, install app and populate a user config in one go?  I really don’t want the user to have to know to install the prereqs themselves or have to make the choice…and i’d really like to pass some info on install to make the application work a little nicer.

I have seen one workaround which stores the querystring data to a cookie, and on startup of the application retrieves this cookie and places the information in the correct location.

Has anyone else come across this problem or am I just trying to do too much in one go?

3D models in your map using V6 collections

johnWeeGo.jpgKeith on the MSDN forums just posted about a quick fix to support collections in V6. This is great news for people who needed to support their basic collections but I wondered if this now means we get 3D models as well? The answer is yes!

3DmodelCollection.jpg

Click on the image to load a basic map with a very basic model of sydney’s centre point tower.

The two additional lines to add are:


VE_CollectionsManagerConstants.Market="";
Msn.VE.API.Globals.language="";

Clustering Virtual Earth 6. Performance, throttling and PNG icons

johnWeeGo.jpgThis weekend I upgraded the code in the clustering example to Version 6 of Virtual Earth. This means we now utilise the bulk add shapes method and the bounds for a birdseye scene. Additionally I added some throttling logic for ajax webservices and showed how to provide legacy support for PNG icons in IE6.

Read the article here:

http://www.viawindowslive.com/Articles/VirtualEarth/ClusteringPinsinVirtualEarth6.aspx 

Geek Girl Blogs Site Released!

BronwenWeeGo.jpgAfter much anticipation, GeekGirlBlogs site went live today.  Many thanks to Scott Barnes, Anna Liu, Catherine Eibner and John O’Brien for their assitance and support.

Geek Girl Blogs aims to create a central repository that brings these women’s blogs together in one place, to create a wealth of knowledge

Show your flair by placing one of the badges that can be found here on your site.

 

Check out the site at www.geekgirlblogs.com

Incredibly slow FireFox on localhost fix – turn of IPv6

johnWeeGo.jpgHaving just built a new computer I have to share this tip for anyone doing cross browser testing and finding firefox really slow to load your pages and assests.

http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx

“It turns out that the slowness is caused by an IPv6 issue with DNS and can easily be resolved by turning IPv6 support off in Firefox while doing localhost testing.  To make the change, type about:config in the address bar, locate the network.dns.disableIPv6 setting and double-click on it to set it to true.  This does the trick for the Firefox localhost issue on Vista and everything is running fast again.”

Linking your LiveIDs

BronwenWeeGo.jpgYou ever get sick of having mulitple liveids and different passwods and trying to remember which one is which (is is it just me) ?

A great new feature has been released that means you can link your liveids, login with just one password and switch between your ids using a combo box..pretty cool hey.

So how do you do this you ask? To link them up do the following:

1. Goto this address https://account.live.com

2. Login with with the id you want to use as your main liveid

3.Goto the Linked  Windows Live Id’s section and select Link Windows Live IDs

linkliveid.jpg

4.Enter your password, and the details for the additional account that you wish to link

linkliveid2.jpg

5. On the settings page you will now see the list of ids that are linked.

linkliveid3.jpg

6. To switch between accounts, just select the account from the drop-down in the top right corner

idselection.jpg

 

 


kick it on DotNetKicks.com

Samsung SCX4200 laser printer – everything i need in 1 small box

BronwenWeeGo.jpgA few weeks back our printer decided it didn’t want to feed paper anymore.  It was an All-In-One type inkjet which was handy for scanning and photocopying but took quite awhile if you wanted to print anything over a couple of pages.

So I decided I wanted a laser printer..but I needed to fill a few criteria:

  • Tray feed – none of this putting 10 pages in the feeder at the top at a time
  • Photocopy function
  • Scan function
  • Quiet
  • Small as possible
  • less than $300

So I looked around and came across the Samsung SCX4200

It fit all my criteria and for $199 I’m pretty happy.  It’s really small, really quiet, does a decent job at printing, scanning, and photocopying and easily holds 1/2 a reem of paper. 

The annoying thing about printers etc. these days is they give you a printer, a “starter cartridge” but no cable!  Lucky the cable from the previous printer works.  Seriously do they need to cut costs that much they can’t toss in a $10 cable that would cost them bugger all?

New Live Alerts Article – Writing Your First Alert Messages

BronwenWeeGo.jpgFor anyone interested in articles on Live Alerts, I’ve posted a new artcle:
 
Writing Your First Alert Messages
This article discusses the basics of the using the Alerts SDK and provides some simple helper methods help you write your first alert messages

There are two different types of Live Alerts:
1. Alerts based on RSS feeds.  Everything you need to know about this type of alert can be found at  http://signup.alerts.live.com/brochure/index.jsp
2. Alerts based on an SDK.  This article concentrates on the Alerts SDK.

Check it out HERE

 

kick it on DotNetKicks.com

Virtual Earth 6 Articles and Videos

johnWeeGo.jpgI’ve been busy with the release of Virtual Earth 6 this week exploring the new features and making some videos and articles.

NewInterface.jpg

A must read for any VE developer is the what’s new Article I just finished:

http://www.viawindowslive.com/Articles/VirtualEarth/WhatsnewinVersion6.aspx

I’m very impressed by this release with no breaking changes and many good new features. The VWL site also has the new getting started article from MSDN if you feel like building your first map:

http://www.viawindowslive.com/Articles/VirtualEarth/GettingStartedwithVersion6.aspx

I have also been having fun with the new features on maps.live.com and made two videos (available in 720p High Definition) on the new 3D models that you can make and import into Virtual Earth 3D and also the new 3D tours.

http://www.viawindowslive.com/Articles/VirtualEarth/Creatingyourfirst3Dmodel.aspx

http://www.viawindowslive.com/Articles/VirtualEarth/Createa3Dtour.aspx

The viawindowslive site is all about community content and resources so if you have something to contribute feel free to get involved:

http://www.viawindowslive.com/Contribute.aspx


kick it on DotNetKicks.com

System.Runtime.Interop.COMException when opening a web project in vs08

BronwenWeeGo.jpgI opened up a solution today to be presented with a nice System.Runtime.Interop.COMException in Visual Studio 2008.  After that my web project wouldn’t open.

After creating a new project from scratch and recreating I found a couple of ways to reproduce it:

  1. The project had been changed to an IIS project and all the IIS requirements hadn’t been installed on the VPC..so instead of a nice error to tell me what I’d done wrong..boom com COMException.
  2. After all the right things were installed, I’d forgotten to run Visual Studio as Administrator…boom COMException.

Hoping that’s all the combinations I find

It’s not the nicest of errors and I don’t remember having that problem on previous versions of Visual Studio but then again, I haven’t run a lot of Web IIS projects on Vista lately.  I guess the annoying thing about it is there’s no option to revert the project back to get it to open.  When you first set the project to an IIS web project if you don’t meet the criteria it gives you a nice error and won’t let you save that option and reverts back.

Does Raid Striping make your HDD fail?

BronwenWeeGo.jpgWe’ve helped a few people set up their home desktop systems.  We were getting them to buy 2 identical HDDs and striping them for added speed.

So since then 3 of us have had one of the array fail…my dad, my best friend and our media centre pc.  All of them were different systems, and all of them were just out of warranty.  Over the years i’ve had the odd HDD crash and usually after treating it badly ie. punching the pc is never good for your HDD.

The other weird coincidence is they’ve all failed in order of when they were setup..first my dad’s then my friends and now our media centre.  2 in a row was coincidental but now with 3 I’d call that a pattern…They say things happen in 3’s so maybe I won’t experience any other problems but I don’t think i’d risk it again.  For our media centre we don’t use that much disk space anyway so John just reformatted the remaining drive and we were up an running again.

Anyone else had any problems with striping drives?




kick it on DotNetKicks.com

Some high ropes fun

BronwenWeeGo.jpgSaturday we decided to have a fun day out and do a ropes course at Adventure Parc. Down near Tambourine National Park, it was an interesting drive..as we were expecting signs..oh well we found it eventually.

One we arrived and handed over our money we’re issued with a set of overalls and a locker key to stash our clothes etc.  Then we’re fitted with a harness, grab some gloves and watch the safety video.

Then it’s off to “the games” – there’s 3 levels – green (easy), red and black.  I’d done something similar many years ago but it was mainly traversing wires and flying down a flying fox.  This one involved pulleys where you had to pull yourself along, various moving logs, ladders etc so was heaps more varried.  So i wasn’t expecting to need quite as much upper body strength and stomach mucles.

T’was good fun but boy was I sore the next day.  I found muscles I never knew existed and it still hurts to laugh.

The place is very well equiped and have staff to supervise and watch out if you get into trouble but the safety gear they provide you with means that you do the course pretty much by yourself (in your group) which is always a bonus.  There were lots of families with youngish children so must be fun for the whole family 🙂

Phillip joins or team

BronwenWeeGo.jpgToday we expand our team and welcome Phillip Suh.

Based in Brisbane, Phillip has been in the IT industry for 7 years working for a range of companies such as Qcom, Praxa and most recently Technology One.

As his meego gives away, Phillip also loves playing base guitar.

Phillip.jpg

New Live Search Article on ViaWindows Live

BronwenWeeGo.jpgFor anyone interested in articles on Live Search, Daniel Wissa has contributed a new article on ViaWindowsLive.

Adding Live Search Functionality To Your Website

This article explains the different ways you can use to integrate Windows Live Search functionality to your website. There are 3 different ways by which this can be done: Using the Basic Live Search Box, using the Advanced Live Search Box and using the MSN Search Web service.
 
Anyone wanting to contribute to the community site should goto the Contribute page and signup.




kick it on DotNetKicks.com

Binding to Object properties in WPF

BronwenWeeGo.jpgBeen experimenting with WPF again.  Wanted to bind a listview to properties of an object.  I wanted to list the meals and types of meals that i’d selected for today.  So I had a List of Meals.

So first I I bound my listview’s itemsource to my list of meals.  This displayed the following:

DefaultBinding.jpg

Which is a bit useless.  My Meal object has a few  properies i want to display in the list…the MealType and the MealName.  To do this in WPF I had to create a data template in the page resources like:

 
    <Page.Resources>
        <DataTemplate x:Key="selectedMealsTemplate">
            <StackPanel>
                <TextBlock Text="{Binding Path=MealType}"/>
                <TextBlock Text="{Binding Path=MealName}"/>
            </StackPanel>
        </DataTemplate>
    </Page.Resources>

and then set the item template property of my list in the xaml to the name of the template e.g.

ItemTemplate="{ StaticResource selectedMealsTemplate}"

Now when i run it looks like this:

DataTemplate.jpg

Now to work out how to make it look pretty


kick it on DotNetKicks.com

Sports photography at WRX Drift

BronwenWeeGo.jpgI bought John a WRX Drift experience for XMas last year and he finally got round to using it yesterday.

I don’t take a lot of sports photos so it’s always interesting taking photos of a moving target.  The problems i have are getting in close enuf to get some good action but not cutting off bits of the car.  I could zoom out and be sure to get everything in but I’m lasy and hate cropping pics and I think it always looks better if the origina snap is on the action.

Wasn’t as much mud and action as I was expecting but got a few pics of mud in the air with a sample above.

Remix Australia 07 session videos released

BronwenWeeGo.jpgA couple of weeks ago the session videos for Remix Australia were released.  If you missed any of the sessions they can be found: http://blogs.msdn.com/postmixau/

John helped in Neil’s sesson on Windows Live Mashups by showing what you can do with Virtual Earth in 10 Mins.  I’ve that section of video below.

kick it on DotNetKicks.com

Via Windows Live – 1 month in

BronwenWeeGo.jpgIt’s been just under a month since launch! So what’s been hapenning in week 4 for ViaWindowsLive?

  • 129 registered users
  • Live Search integrated on the site
  • Showcase site for Snapsis Menu – http://demo.snapsis.com

Consolidating communications bills – internet and phone in a SOHO

BronwenWeeGo.jpgWhen we first started working in a virtual office we looked at our internet and phone usage.  It’s been awhile since we last looked at how it’s going so it ‘s time for me to review what we need and should have.

What we have now: Mobile phones,  Telstra cable, Internode ADSL2, Telstra Business Landline, Engin landline, Skype/Skype Out

What’s important: Fast reliable internet that can have a fixed IP address and handle 2 people using bandwith consecutively, Mobile phone for availability, some form of landline to keep friends, family and ppl like banks happy.

So what can i do to improve these: Pretty much, prices/offers haven’t changed.  About the only thing I can see is to get rid of the engin phone to save some $$ and/or upgrade the cable to the faster upload speed.

The history of how we got here:

In the beginning we had Telstra Bigpond cable and an optus landline.

Back then we were paying $50-60/mth to make a couple of calls per month interstate etc. The worst part of the landline was the 12+ telemarking/charity calls a day we were getting which are 1. annoying and 2. distracting.  John decided the landline had to go.  So we dumped the landline and signed up for Engin.  It gave us free calls to others on Engin and 10c untimed calls nationwide with a $10/mth access fee.  So we pretty quickly reduced our phone bill.

When we were both working virtually, we quickly discovered that if someone was on the phone and the other was on the internet downloading something it was causing issues.  We both couldn’t be on skype at the same time effectivly etc.  We get an ok download speed from the cable but the up speed is pretty bad – 128K.  This is really frustrating when you want to upload holiday pics etc.  The best we could do with cable was to go up a plan to 256k up so we looked into ADSL.

After John did a lot of hunting around we decided to go wither Internode as they were getting ADSL2 in what we assumed to be our exchange.  The annoying part was noone could give us an indication of what speeds we could expect until you put it in.  For some reason, they also couldn’t guantee which exchange we’d end up on as we didn’t have a real phone line anymore so couldn’t test it.

Pretty much we had to get a Telstra landline.  As it was for a business we had to get a business line and the cheapest one is $35/mth.  It cost $299 to reattach the old line…doh!  So we kept both cable and ADSL2 going at once till we could evaluate it.  We quickly discovered that we weren’t going to get as good a download speed on the ADSL as we were 3k from the exchange.  The upload speed is pretty decent..close to 1MB.  The important feature when getting the ADSL2 was to get one that provided a fixed IP address.  A few customer and services we use require you to have a fixed IP address.

So our problem was clear…cable gave better download, ADSL2 better up.  So we kept both which effectively doubled our internet access bill.  While this is annoying it had been useful.  Quite often one or the other service will go down randomly for a few hours and we can both switch to the other service.

So now we effectively have 2 landlines.  One we never use as it just provides the ADSL and the Engin line for calls. 

We use skype more and more each month and have been using Skype Out accounts for customers that don’t have a skype account.  This makes it pretty cheap to call a mobile number overseas etc.  So we can save a few $/mt by getting rid of the Engin line, getting ppl to call us on the Telstra landline and using skype and our mobile phones to make most of our calls.

So I’m up for suggestions on how to improve this…

 




My first play with LINQ and XML

BronwenWeeGo.jpgI’ve been experimenting with the .Net 3.5 framework, so I thought this was a good opportunity to play with LINQ.  I’ve starting doing some spikes to see what’s going to bite me.  For this spike project I’m accessing all my data from XML files rather than SQL Server and using Orcas Beta 2.

So if I’m doing something wrong, or I could do it much simpler..please let me know

Normally I would have created an xsd and used the xsd.exe tool to generate my .Net Classes.  This has always annoyed me since moving to .Net 2 as it generates arrays..which I try never to use anymore and I always end up manually editing the classes to turn the object[] to List<> .

When I first hooked up my XML file that was based on an XSD to LINQ I found it didn’t like the namespace as it’s a strongly typed XML file.  I came across the LinqtoXSD tool and quickly discovered it is for Orcas Beta 1..doh!

So I bit the bullet and created all the classes myself that the XSD tool would normally generate for me. Normally I’d be dead bored, turning all my fields into properties etc and end up with a bunch of really long classes I have to maintain…but wth the changes in .net 3.5, this means i can use Automatic Properties .. YAY.

So a lot of my classes look something like this:

    public class Food
    {        public string FoodName { get; set; }
        public string FoodGroup { get; set; }
        public int CaloriesServe { get; set; }    }

How awesome is that! So many less lines of code!

So I started with a number of food items in an XML file like this:

 <?xml version="1.0" encoding="utf-8"?>
<FOODITEMS>  <FOOD>    <FOODNAME>Banana</FOODNAME>
    <FOODGROUP>Fruit</FOODGROUP>    <CALORIESSERVE>66</CALORIESSERVE>  </FOOD>
  <FOOD>    <FOODNAME>TBone 300Gms</FOODNAME>    <FOODGROUP>Meat</FOODGROUP>
    <CALORIESSERVE>300</CALORIESSERVE>  </FOOD>  <FOOD>
    <FOODNAME>Carrot Small</FOODNAME>    <FOODGROUP>Vegetables</FOODGROUP>
    <CALORIESSERVE>23</CALORIESSERVE>  </FOOD></FOODITEMS>

To load all my food into a list I used to do something like:

            List items = new List();
            FoodItems foodItems = new FoodItems ();
            XmlSerializer reader = new XmlSerializer(foodItems.GetType());
            StreamReader file = new StreamReader(GetFileName(FOOD));
            foodItems = (FoodItems)reader.Deserialize(file);
            file.Close();

Now using LINQ it looks something like this

            XDocument FoodItemsXml = XDocument.Load(GetFileName(FOOD));
            var temp = from feed in FoodItemsXml.Descendants("Food")
                            select new Food                            {
                                FoodName = feed.Element("FoodName").Value,
                                FoodGroup = feed.Element("FoodGroup").Value,
                                CaloriesServe = Convert.ToInt32(feed.Element("CaloriesServe").Value)
                            };            return temp.ToList();

So then I got a bit more complicated and had a xml elements that can have many xml elements.  So I had a Meal Plan that had many Meals which had many food items along with a number of other properties.  My LINQ Statement to grab this looks like:

            XDocument MealPlansXml = XDocument.Load(GetFileName(MEAL_PLAN));
            var temp = from feed in MealPlansXml.Descendants("MealPlan")
                       select new MealPlan                       {
                           MealPlanType = feed.Element("MealPlanType").Value,
                           Meals = (from meals in feed.Elements("Meal")
                                    select new Meal
                                    {
                                        MealType = meals.Element("MealType").Value,
                                        DayNo = Convert.ToInt32(meals.Element("DayNo").Value),
                                        Serves = Convert.ToInt32(meals.Element("Serves").Value),
                                        FoodItem = (from fooditem in meals.Elements("Food")
                                                    select new Food
                                                    {
                                                        FoodName = fooditem.Element("FoodName").Value,
                                                        FoodGroup = fooditem.Element("FoodGroup").Value,
                                                        CaloriesServe = Convert.ToInt32(fooditem.Element("CaloriesServe").Value)
                                                       
                                                    }
                                                   ).ToList()
                                    }
                                    ).ToList()                       };
            return temp.ToList();

Now I’ve just gotta work out how to load this in more simply.




kick it on DotNetKicks.com