Friday, November 30, 2007

LINQ Tips

Composite Key

I was looking for the syntax for a composite key join. I could only find it for 3 tables that were chained to gether by mutiple columns. Here's the join syntax for two tables that have 2 columns in column:

var vResult =

from t1 in table1

join t2 in table2 on
new {t1.Key1, t1.Key2} equals

new{t2.Key1, t2.Key2}

select
new {t1.Column3, t2.Column4};

Interesting Syntax

I also found the syntax for a "shaped" return of data. Here's some pseudo:

var vResult =

from t1 in table1

join t2 in table2 join t1.Key1 equals t2.Key1 into Shape

select {t1.Key1, Shape};


I hope these help someone, as I was looking around for a little bit to find these simple nuggets of truth.

Thursday, November 29, 2007

.Net Framework v1.1 sp1 Install Error

I was trying to install the .Net Framework 1.1 service pack 1 (sp1) and kept getting an error (code 80070002). Unfortunately the fix described by the code doesn't work.

I went looking around on the net and found this post from someone who was trying to get the service pack to play a particular game.

Here's the link I came across that has a pretty well document procedure for installing the service pack:

http://forums.lotro.com/showthread.php?p=733941

Tuesday, November 27, 2007

WCF IEnumerable Problem

I was working on a WCF service/client application when I decided to make a change to one of my service contract operations.

I changed a property type in one of my data contract data members from List<CustomObject> to IEnumerable<CustomObject> Of course I was making several changes at the time, and didn't realize until a fair amount of time later that this would not serialize correctly.

I have a theory that adding "[ServiceKnownType(typeof(CustomObject))]" right after the ServiceContract declaration will allow the service/client to serialize and deserialize correctly, but I'll have to wait test it out when I have time.

If anyone gets a chance to test it out before I can, please, comment below and let me know how it worked for you.

Wednesday, November 21, 2007

An Interesting Article…

I hope not to need this advice any time soon, but I came across a good link to this article:

"Bloggers beware: You're liable to commit libel" by Steve Tobak

It describes your rights as a "publisher" and what kind of burden of proof would have to be presented if you publish defamatory statements.

It's a nice simplified synopsis of the laws surrounding libel suits.