The mysteries of software development and networking... RSS 2.0



 Sunday, November 11, 2007

Earlier this year the C# team implemented a change in the design of anonymous types. It used to be possibly to create an anonymous type and then change a property on the anonymous type. The code would look like this:

var x = new { Name = "Mark", Age = 0 };
x.Age = 35;

In Visual Studio 2008 beta 2 this is however no longer possible since anonymous types are now immutable. There are apparently good reasons for doing this and Sree explains it in this post and there is an issue on MSConnect where Mads from the C# team explains the reasoning. Must say I don't completely get the reasoning, especially since VB.NET does not have this restriction.

Sunday, November 11, 2007 11:23:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C# | LINQ

The website www.hookedonlinq.com has an excellent article explaining the basics of LINQ to SQL. It's called LINQ to SQL - 5 minute overview.

Sunday, November 11, 2007 10:47:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
LINQ

If you want to join data which is in a list with data that is in the database, then you need to use the 'Contains' operation.

The code below shows that we have a list containing two values, next we want to join this list with some data in the database. This data has an Id and an Description.
You might be tempted to use the join operator, but that will fail, instead, call the Contains() method.

static void Main(string[] args)
{
    List<int> l = new List<int>();
    l.Add(1);
    l.Add(2);

    CustomerInfoDBDataContext db = new CustomerInfoDBDataContext();
    var result = from pi in db.PersonalInfos
                 where l.Contains(pi.Id)
                 select pi.Id + " - " + pi.Description;

    foreach (var info in result)
    {
        Console.WriteLine(info);
    }
    Console.ReadLine();
}

Sunday, November 11, 2007 10:39:03 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
LINQ

Niels confirmed it for me. Yes, it is possible to run a LINQ to SQL query in SQL Server 2008 using a .NET managed stored procedure.

As he puts it: "yes you can - but as soon there are any transactions invloved things will go pear-shaped".

Note that there will also be an optimized LINQ to SQL provider as part of SQL Server 2008:

"Language Integrated Query (LINQ) enables developers to issue queries against data by using a managed programming language such as C# or Visual Basic.NET, instead of SQL statements. LINQ enables seamless, strongly typed, set-oriented queries written in .NET Framework languages to run against ADO.NET (LINQ to SQL), ADO.NET DataSets (LINQ to DataSets), the ADO.NET Entity Framework (LINQ to Entities), and to the Entity Data Service Mapping Provider. SQL Server 2008 features a new LINQ to SQL Provider that enables developers to use LINQ directly on SQL Server 2008 tables and columns."

Sunday, November 11, 2007 8:01:04 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
LINQ | SQL

Yesterday I spoke at the iSDC and Ronua Community Workshop. We had a great day and it was a pleasure meeting the people at iSDC, meeting the developers in Cluj and surroundings (some drove over 200km to make it to the meeting) and Petru Jucovschi (the DPE for Microsoft Romania).

Here are the two presentations that I did:

11-09-2007 - Developing Windows Vista gadgets.pptx (431.43 KB)

11-10-2007 - 2008.NET.pptx (252.91 KB)

In the Visual Studio 2008 presentation I also talked about the work I've done for AOL. The AOL developer site can be found at http://dev.aol.com and for more reference material on Vista gadgets you can visit my AOL blog.

Sunday, November 11, 2007 3:32:20 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
C# | General | LINQ | Vista | WCF

During my session yesterday at the iSDC and RONUA Community Workshop I received a question on how to do a group by together with calculating the sum of the group.

I couldn't remember the right syntax and had to go and look it up. There is actually a sample included on the 101 Linq Samples page (thanks Dragos!).

The query looks like this:

public void Linq80() {
   List products =
GetProductList();

   var categories =
      from p in products
      group p by p.Category into g
      select new {Category = g.Key, TotalUnitsInStock = g.Group.Sum(p => p.UnitsInStock)};

   ObjectDumper.Write(categories);
}

Sunday, November 11, 2007 3:14:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
LINQ
 Friday, November 09, 2007

If you've been using Team Foundation Server 2005 and created one or more branches then you'll probably have noticed that when you look at a files history it will only show it to you for the current branch. When determining the history of a file this is definately not good enough. Luckily Yonatan Leonov created a little Visual Studio Add-In which allows you to see the complete history of a file. It's available for free on CodePlex. Go here.

Friday, November 09, 2007 12:50:34 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Team System
 Thursday, November 08, 2007

The article I wrote for AOL, 'Xdrive as Data Storage Device for Windows Vista Gadgets', got published on their site this week. I'm pretty happy with it. It gives a step by step account of how to create a Vista gadget and also shows how to use AJAX to upload a file, which had me up debugging stuff for quite some time.

Thursday, November 08, 2007 5:57:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | Vista
 Wednesday, November 07, 2007

Sometimes you just run into something so geeky, yet so cool that you just have to post a link :-)

Andrew Dugdell experimented and found out he can use his iPod to store a VHD file (the file format used by VirtualPC) and run the virtual machine from his iPod. Excellent!!!

Wednesday, November 07, 2007 12:38:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Monday, November 05, 2007

Somasegar has told the audience at TechEd 2007 that Visual Studio 2008 is on schedule for RTM before the end of November. Huh? Wasn't the release date set for February 2008? Yes it is. There is a difference between RTM, which means Release To Manufacuring and 'launched' in terms of marketing effort. It used to be that software was not available until the CD/DVD was in your hand. Nowadays RTM means: 'send to DVD factory AND make available for download'. So when VS2008 goes live this month it will be available to MSDN subscribers on via their MSDN Subscription account and it will be available on DVD in February 2008.

Monday, November 05, 2007 1:00:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

Our (=SDN) quarterly event is coming together. The session schedule is complete and registration is open. The topic this time is 'Usability'. Want to learn, share, see, meet and have fun? Sign up now!

  


Sessions

C#

Visual Basic.Net
DotNetNuke
Delphi
Inform. Worker
General
8:30
Registratie / Ontvangst
9:00

Software Factories; Does it really help your customer?

Dennis Doomen

VB2005: Object georiënteerd programmeren in praktijk

André Obelink

Introductie DotNetNuke - een website online binnen één uur

Peter Schotman

Delphi 2007 and Vista

Marco Cantù

Usablitity: voor wie wordt er eigenlijk ontwikkeld?

Bas Hoogendijk & Thomas Veltman

Even geen ADO.NET

Marcel Peereboom & Rolf Eleveld

10:15
Pauze - 30 min.
10:45

Breng je Backend naar de Frontend met Script#

Christiaan van Bergen

3D graphics voor de VB.Net ontwikkelaar

Dennis Vroegop

Silverlight: Hello World... en dan?

Stefan Kamphuis

Webcam Fun met Delphi 2007

Bob Swart

Customize Sharepoint met de juiste tooling

Mike Glaser

Nieuw in Firebird

Martijn Tonies

12:00
Lunch - 60 min.
13:00

Do’s and Don’ts van Mobiele applicaties

Jaap van Ekris & Frans Kouwenhoven

Microsoft patterns & practices: Enterprise Library

Olaf Conijn

 

Improve the skinability of your module

Timo Breumelhof

Usability in CodeGear 3rdRail

Pawel Glowacki

Design en Navigatie in MOSS 2007

Dirk Zekveld & Mirjam van Olst

Windows Live Search

Willem Boeré

14:15
Pauze - 15 min.
14:30

Ontwikkelen met Silverlight

Robertjan Tuit

Coding Dilema's

Pieter Joost van de Sande &
Christiaan van Bergen

Ajax with zero code

Leigh Pointer

Migratie: van BDE naar BlackfishSQL via dbExpress

Bob Swart

Building Internet Sites with MOSS 2007

Donald Hessing & Marco Scholten

Windows Live for Developers

Dennis Vroegop & Marianne van Wanrooij

15:45
Pauze - 30 min.
16:15

Aspect Oriented Programming in .NET

Pieter Joost
van de Sande

Panel discussie: Software Factories

Conijn, Mulder,
de Vries, Warmer

DotNetNuke Q&A

Erik van Ballegoij

Delphi Dynamic Architectures with Packages

Marco Cantù

OBA: Enhancing the usability of your Business Process

Wouter van Vugt

 

17:30
Einde

 

Monday, November 05, 2007 12:52:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Thursday, November 01, 2007

Typed DataSets offer a great way to implement the interaction with a database. When using typed datasets in conjunction with source control, like Team Foundation Server, then things get a little tricky. TFS offers optimistic check out (a.k.a. side by side checkout), which means that multiple persons can work on a file at once. If a conflict is detected upon checking in, then the user has the option to use a mergetool to resolve the differences. This works great for most source files, but not so good on designer generated files. This problem manifests itseld a lot around typed datasets, where merging the designer generated files can wreak havoc on your sources and 'break' the designer.

Instead I prefer to use exclusive checkout when editing typed datasets.

To set your source control to allow exclusive checkouts go to the Options page in Visual Studio and set 'Editing' to 'Prompt for exclusive checkouts':

Next time when you are editing a source controlled typed dataset you will get the following question:

Choose the second option (outlined in red) and you'll be fine when checking in.

Thursday, November 01, 2007 12:37:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Team System

I just reinstalled Plaxo for Outlook 2007. A great tool which I used to use for Outlook 2003, but initially I had some problems running the integration on Vista with Outlook 2007. A couple of versions down the line these problems appear to be solved and my address book now synchronizes quite smoothly with my Plaxo account. The great thing about Plaxo is that it will automatically update all the contact info of my friends and contacts as soon as they make a change in their info, assuming ofcourse that they also run Plaxo.

To join the social network frenzy there is now also something called 'Plaxo Pulse' a kind of Facebook like way of keeping track what your friends and contacts are doing. It's interesting and since I upgraded to the latest version of Plaxo I seem to automatically be on Pulse. So I'll give it a try and see how it compares to Facebook.

As far as I can tell there is no Pulse API available yet. Although several parts of Plaxo are accessible through the Plaxo developer API. Personally I believe the Open Facebook API to be a great part of Facebooks succes.

Thursday, November 01, 2007 9:52:03 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Wednesday, October 31, 2007

Here are some events that I'm involved in, either as speaker, and/or as (co)organizer:

Wednesday, October 31, 2007 1:28:13 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

I just finished my sample of the week for my AOL blog. This week I created code to upload a file to XDrive using the HttpWebRequest object. The sample is also useful if you're trying to find out more about uploading a file using C# (or the .NET Framework).

Wednesday, October 31, 2007 11:17:39 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | C#

The majority of the time when we look at AJAX we look at making websites more responsive, prettier, faster. Rarely do we (or at least I) think about accessibility features for people that are visually impaired, or deaf or otherwise less able to read my, usually, small print on a website.

Chris Blouch has released a JavaScript library which focusses on making the web 2.0 generation of website more accessible. He has posted a slidedeck from his session at the Ajax Experience Boston (October 26, 2007) online, and the library, including documentation, can be found here.

I particularly found his statistics slide an eye-opener...

Among adult computer users in the US:
  • 1 in 4 has a vision difficulty
  • 1 in 4 has a dexterity difficulty
  • 1 in 5 has a hearing difficulty
  • Projected to be 70M users by 2010
Wednesday, October 31, 2007 11:11:55 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
ASP.NET
 Monday, October 29, 2007

After taking a look at becoming an Amazon.com affiliate last week, I decided to place some Google Ads on my blog page as well.

Steps to take:

1. Sign up to Google AdSense.
2. Confirm account.
3. Use the Google site to create a banner appropriate for this blog, then copy and paste the JavaScript code into my site. For DasBlog I modified the 'homeTemplate.blogtemplate' file of the theme that I use for this blog.

It's pretty interesting, the first two or three hits on my site generated pretty random ads, but now they all seem to be IT related. Nifty!

Monday, October 29, 2007 3:32:35 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

Hurray, I just upgraded this blog to version 2.0.7226.0 of DasBlog. Pretty painless install. The 'dasBlogUpgrader' program worked smoothly :-)

Monday, October 29, 2007 3:27:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

When installing Vista it will, by default, enables shadow copy and system restore points. While definately very useful (and I DO use these on my host OS) I don't like the overhead they create, so I disable this for my virtual machines.

Monday, October 29, 2007 1:31:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Vista
 Thursday, October 25, 2007

.NET 2.0 has no special support for REST and JSON. That doesn't mean you can't call a REST resource and pass it a JSON object. In my weekly AOL post I demonstrate how to use WebRequest, WebResponse and basic string manipulation to call a REST resource and pass a JSON object.

Thursday, October 25, 2007 9:15:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | C#
About
This blog is run by Mark Blomsma.
© Copyright 2008
Develop-One
Sign In
Statistics
Total Posts: 320
This Year: 64
This Month: 2
This Week: 0
Comments: 76
All Content © 2008, Develop-One
DasBlog theme 'Business' created by Christoph De Baene (delarou)