"" - Alex Trebek, SNL's Celebrity Jeopardy!
| Blog General Travel Sport Hockey Technical Gaming Pages Travel Plans Live Music Links About Blog Archive Current Blogs March 2010 (1) February 2010 (3) January 2010 (5) December 2009 (1) November 2009 (1) October 2009 (1) September 2009 (1) August 2009 (2) July 2009 (1) June 2009 (2) May 2009 (3) April 2009 (1) March 2009 (1) February 2009 (13) January 2009 (1) 2008 (25) 2007 (67) 2006 (23) 2005 (32) 2004 (10) Blog Tags General 10 in '10 (4) Books (1) DVDs (2) Funny (12) Gadgets (5) Hawt (1) Movies (13) Music (6) Pets (3) Recipe (14) TV Shows (1) Web (27) Travel Calgary (2) Edmonton (12) New York (7) Niagara Falls (2) Pittsburgh (5) Washington (4) Sport Basketball (1) Running (3) Hockey Pittsburgh Penguins (25) Technical .NET (3) Java (4) Software (3) Work (2) Gaming Commodore 64 (2) Master System (1) Mega Drive (1) Xbox 360 (15) XNA (1) GamerTag ![]() The rarely updated blog of Joel Dixon | Viewing blogs tagged .NETSunday, February 01, 2009Enum Members and the .NET Compact Framework# Posted by Joel Dixon at 01/02/2009 16:37:16When working on my latest weekend coding project, I am occasionally limited by the methods offered (and not offered) by the .NET Compact Framework (XNA projects are compiled against the compact framework). Usually these limitations are pretty minor (i.e. as TryParse is not available, I need to put a try-catch block around a regular Parse call). Today I stumbled over another unavailable method - Enum.GetNames(). The GetNames method is called when using Reflection to determine, at runtime, the elements in an enumeration. It took a bit of hunting and experimenting - but here's a Compact Framework-friendly method of achieving the same thing: C# Code:
It's pretty good that Reflection is included in the compact framework - but it's slightly surprising that they couldn't fit in the Enum.GetNames() method as well. # Posted in the Technical section and tagged as: .NET, XNA Comments (0) | Add Comment Friday, June 17, 2005Java Snob# Posted by Joel Dixon at 17/06/2005 17:52:00Java has been my programming language since my first year at university (1999). Before Uni I had toyed with Basic, Turbo Pascal and VBA (Visual Basic behind Access / Excel) for VCE, but my largest programming experience was Batch files on our home computer. I really took to Java at uni, and programmed a few things in my own time (a calculator and text editor). When I started my graduate job I was put on a Java maintenance project, which I enjoyed a lot for the first few years. Since then, I have also been toying with my shape drawing program in my spare time - which I also enjoy. I haven't coded much Java lately, as I've been doing .NET work and recently been on a BizTalk Server course which I enjoyed thoroughly. Tonight I decided to play with my shape drawing program and try to get some work done. So I started JBuilder and couldn't start - I've been spoiled by Visual Studio, and .NET development. JBuilder's Form Designer is shite - and wiring up event processing is tiresome. The IntelliSense was also limited compared to what I've been used to. A mate from work was saying that .NET development was very enjoyable - I'm starting to understand why. So I've closed by JBuilder - and I'm not sure if I'm going to opening it again from home. Perhaps more Java projects at work will change my mind - but for now I think I'll be happy with .NET. Unless there's a client that wants an MS-DOS Batch File solution ![]() # Posted in the Technical section and tagged as: .NET, Java Comments (0) | Add Comment Thursday, April 07, 2005ADO.NET Strongly Typed Relationships# Posted by Joel Dixon at 07/04/2005 01:55:00Updated by Joel Dixon at 21/09/2007 04:03:35 - added comment captcha It's been over a month since my last blog - but that's OK - I'm sure no-one will mind! I've decided to add a little technical advice about accessing data with Strongly Typed DataSets in ADO.NET. Reason being, I spent over an hour looking for this information before I finally tracked it down on someone's blog. After my post, it will double the amount of blogs with this information ![]() In my ASP.NET WebService, I like to use strongly typed DataSets to access my data with ADO.NET, it's a whole lot cleaner that way. For my example, let's say we have a Customers table, and an Orders table. Customers are identified by their CustomerID, and orders by their OrderID (yes, I'm using Northwind). The Orders table also has the CustomerID that made the order (a one to many relationship). Defining the strongly typed DataSet for this in Visual Studio.NET is quite easy:
Now that you have the strongly typed DataSet, you can directly refer to column names. For example, instead of: Code:
you can use: Code:
That was all good - but I wanted to look at the Orders that are assigned to a Customer (as per the relationship I added above). Most examples were telling me to do something like this: Code:
This gets the job done - but we're back to using things like orderRow["OrderID"] instead of orderRow.OrderID. The disadvantage to using GetChildRows is that it returns an array of DataRow's - not Orders. A way to achieve the above code using your strongly typed relationship is as follows: Code:
When the relationship was created above, it added a GetOrdersRows() method on the CustomersRow object. It may not seem like much - but having the strongly typed OrderRow can help (well, it helped me). After doing a quick search on GetOrdersRows() (to see if I had missed any examples of this) - I found a good ADO.NET tutorial. I wish I had have found that a few hours ago! # Posted in the Technical section and tagged as: .NET Comments (5) | Add Comment | Blog Search Recent Blogs Yeah ... Baby! xkcd Parody Donate money for my next stupid run Feta, Sushi and Underwear Pimpy McHat Attack Chai did it! 10 things for 2010 Party like it's 1999 Literal Music Videos Green Day - Melbourne, 2009Feed Blog EntriesRecent Comments Green Day - Melbourne, 2009 posted 3 months ago by joeldixon The Offspring is probably the one that I most want to see next - except for maybe Daft Punk. I'm ... link Green Day - Melbourne, 2009 posted 3 months ago by Brad Can't believe it took you this long, but as far as first concerts go Green Day would have to be ... link Great Australian Run - 2009 posted 3 months ago by joeldixon Thanks Hitman - the "we stuffed up the distance" article generally takes a few days to be released - so ... link Great Australian Run - 2009 posted 3 months ago by Hitman Hey Dixon, I haven't read any articles suggesting otherwise, so I will take you at you word that you ran ... link I ran a[n eighth of a] marathon today! posted 5 months ago by joeldixon I should be fine. I'm sure the 15km will only be around 850 meters, after the measuring errors etc :) link Comment Standings 1. the man with no name (45) 2. Hoff (39) 3. Gav (27) 4. Hitman (25) 5. Brad (22) 6. Eryc-Ads (13) 7. Deep Lurker (6) 8. thefury (5) 9. Dieter (4) 10. Zelks (4) |
![]() About This Site | Contact Me | ||