Friday, October 03, 2008

How great is that session title?

I'm happy that I don't have a session scheduled at the same time that Alex and Paul are doing this talk during the SDN Conference in Amsterdam next week. If the session is as entertaining as the title, it will be quite a lot of fun to attend! (Of course, it is likely to be in Dutch so I might miss a few good parlays.) Paul's one of the reviewers of my book, so I expect him to be able to go pretty deep into EF's capabilities and provide a good challenge based on what he's learned.

Alex Thissen and Paul Gielens take will compete with two major innovations in the field of data access, namely: the new Entity Data Model - which is part of the ADO.NET Entity Framework - and linQ (Language Integrated Query) to SQL queries to integrate into the programming languages.  What are these technologies, how do they compare to each other, what role they play in Microsoft's Data Access Strategy and when to use what? Of course, there is only one winner!

Friday, October 03, 2008 5:09:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 

Although I mentioned this in a blog post last month about the DevTeach early bird special pricing, I thought I would highlight this to see how quickly we could pack the room! :-) Not that the prospect of a full day of EF shouldn't be enticing enough. But I thought that it would be nice to reward like-minded data geeks.

I will be giving away a full VSTS2008 Team Suite MSDN Premium Subscription to attendees of the workshop. That's the one that's $10,000 new and I think about $3000 for a renewal.

Here's more info about the Entity Framework workshop which is on December 5th.

If Montreal doesn't work for you, don't forget that John Papa is doing the same (giving away an MSDN subscription) for his Silverlight class in Florida!  Day of Silverlight 2 and a Free MSDN Premium Subscription. Great minds think alike!

Friday, October 03, 2008 3:22:13 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

This cost me two very precious hours today, so I thought I would share.

In preparing my laptop for my upcoming trip, I needed to get the latest version of an app I wrote for a client in case I need to do any work for them while I'm away. The application uses the latest version of Crystal Reports which caused me a great deal of grief when I recently moved to it. (See my ASPAlliance article: Lessons Learned: Sorting out Crystal Reports 2008 Versioning, Service Packs and Deployment for details).

Today's time-sucker was not Crystal's fault but the fact that when I installed the earlier version of Crystal on to the laptop, I had done it from an external drive.

When I tried to install the newer version, it chugged along then said that it failed because it couldn't uninstall the previous version.

I attempted to do the uninstall myself from the Control Panel but that failed with this message:

""Error applying transforms. Verify that the specified transform paths are valid"

Some googling pointed out that if I copied the original install files to my hard drive and ran setup from there I could avoid the problem.

That didn't work.

Finally I discovered that within the registry (in Computer\HKey_CLASSES_ROOT\Installer\Products\) there was a folder that contained the Crystal install information. In there was a key called "Transforms" which pointed to F:\Extended\Package\1033.mst. F:\ must have been the path of the external drive when I originally installed the app.

I changed the path of that file to the folder that I had just copied onto my hard drive.

Then I was able to uninstall, not from the Control Panel, but form the setup.exe from that same set of installer files.

Hopefully I'll save somebody the hours and frustration I wasted myself. If you're really grateful, just send chocolate. :-)

Friday, October 03, 2008 2:07:00 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [4]  | 
 Thursday, October 02, 2008

finalcoverAs we begin the push of getting my book, Programming Entity Framework, towards production, it is still going to be a number of months before it is out in print. Currently, OReilly is targeting January 2009.

But why wait for paper (and the perfection of the final edits)?

We've decided to take my work in progress and make it available as a Rough Cut  title on OReilly.com and Safari.

The first set of chapters, which are introductory, will appear sometime in the next few days and I'll post the links as soon as I have them.

Thursday, October 02, 2008 2:04:35 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Wednesday, October 01, 2008

London Girl Geek Dinners just celebrated their 3rd Anniversary. Since its inception, the idea has taken hold and there are now GGDs all over the world. Read more here!

 

[A New DevLife Post]

Wednesday, October 01, 2008 9:05:45 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, September 30, 2008

The sun just came out so even though I'm trapped working, I ran out the door to snap some pictures. It's been warm so the leaves are turning  a little early. It's going to cool down so that will slow down the process a little.

These are all right from my front yard.

fall leaves and jorgina 003

fall leaves and jorgina 014

fall leaves and jorgina 009

That's our neighbor's cat, Jorgina, who likes to hunt in our field. :-)

fall leaves and jorgina 011

Lots of apples in the trees...

fall leaves and jorgina 010

...but mostly on the ground.

Tuesday, September 30, 2008 2:43:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

I saw this thread  early this summer and have spent hours looking for it since. Since i just came across it, I thought I would make a blog bookmark to it.

Multiplicity of 0..1 and SQL eager loading problem

Here's what the thread is about. When you query an entity that has a parent, for example an OrderDetail, that query will go over to Order so that EF can build the related EntityKeys. This is because when OrderDetail is materialized, it will need to populate OrderDetail.OrderReference.EntityKey.

If you query Orders and you don't eager load the details, there is no reason to touch OrderDetails in the query.

But what if  you have a 1: 0..1 relationship between the "parent" and "child" instead of 1:*?

The child property is no longer an EntityCollection, but an EntityReference. Therefore the EntityKey for that EntityReference needs to be constructed. So even if you don't include the children in the query, the store query will still have to seek out the child record to create it's EntityKey if it does exist.

I have such a relationship in my model.

 

onetozeroorone

 

If I query only for Contacts:

From c In context.Contacts Where c.FirstName = "Robert"

You can see the left outer join in the SQL query that is used to build the CustomerReference.EntityKeys.

SELECT 
1 AS [C1], 
[Extent1].[ContactID] AS [ContactID], 
[Extent1].[FirstName] AS [FirstName], 
[Extent1].[LastName] AS [LastName], 
[Extent1].[Title] AS [Title], 
[Extent1].[AddDate] AS [AddDate], 
[Extent1].[ModifiedDate] AS [ModifiedDate], 
[Extent2].[ContactID] AS [ContactID1] 
FROM  [dbo].[Contact] AS [Extent1]
LEFT OUTER JOIN [dbo].[Customers] AS [Extent2] ON [Extent1].[ContactID] = [Extent2].[ContactID]
WHERE [Extent1].[FirstName] = 'Robert'

The problem for Sean was that he was querying Contact but Contact has 1:0..1 relationships with 52 other entities. So he was getting 52 outer join  and he reported that he was getting 2800 extra columns. Imagine his surprise! I'm only getting the extra ContactID column. I wonder if he meant 2800 extra pieces of data? Either way, it's something to be aware of and in the thread Diego Vega suggests a way to avoid this which is to query with NoTracking so that the relationship info (CustomerReference.EntityKEy) is not needed.

The same query with MergeOption set to NoTracking is:

SELECT 
[Extent1].[ContactID] AS [ContactID], 
[Extent1].[FirstName] AS [FirstName], 
[Extent1].[LastName] AS [LastName], 
[Extent1].[Title] AS [Title], 
[Extent1].[AddDate] AS [AddDate], 
[Extent1].[ModifiedDate] AS [ModifiedDate]
FROM [dbo].[Contact] AS [Extent1]
WHERE N'Robert' = [Extent1].[FirstName]

If you need to do tracking or relationships, then attach the entities after the fact.

Now if only I can remember what I was looking for in the forums before I happened upon this long lost thread!

Tuesday, September 30, 2008 8:11:52 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, September 29, 2008

Oh happy day, I finally woke up and discovered that StringFormat was added to SP1.

Here's a quick rundown on Lester Lobo's WPF blog: WPF 3.5 SP1 feature: StringFormat

This solves a huge problem that i was having in my book where I wanted to format a date but didn't want to side track readers with how to write an IValueConverter or how to write partial classes (a topic that is not addressed until a later chapter). Phew!

Monday, September 29, 2008 5:19:44 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

This weekend I'm heading off for conferences in Europe (SDC Netherlands, DevReach in Sofia and some Girl Geek Dinners in between (Amsterdam & London)) but there is a notable event in San Francisco at the same time that I want to recommend if you are a last-minute (but can't quite make it to Europe) kind of a person.

IASA Connections in SF has a collection of some highly respected architects in our industry. David Chappell, Juval Lowy, Rocky Lhotka, Kathleen Dollard, Michele Leroux Bustamante and more.

Kathleen is a speaker and an IASA member and even she is gaga over the list of presenters.

She also divulged how to get a $400 discount if you are still wavering... do that by clicking this link. When you register on line scroll to the bottom and enter the discount code “SPEAKER”. The discount should appear on the next confirmation page so you can ensure you’ve got your discount before you commit.

Monday, September 29, 2008 3:00:45 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Sunday, September 28, 2008

Claudio Perrone is a developer who is passionate about Agile practices. We when we were both presenters at the Developer Summit in Stockholm this past spring. We had a lot of chats about presentation style and I've been very inspired by what he showed me and got me thinking about. I learned the hard way that people attending presentations to learn something very technically specific really need some bullet points. But when it comes to talking about concepts or theory or telling a story, Claudio uses the Presentation Zen like an art form.

He's doing a session at OREDev in Sweden in November. It looks like a great conference with Ted Neward, Jimmy Nilsson and Eric Evans on the speaker slate.

Claudio has done an awesome 1 minute video trailer as a teaser for his session "Agile tales of creative customer collaboration". Definitely check it out (with sound on).

Sunday, September 28, 2008 7:33:40 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Friday, September 26, 2008

Roger Jennings wrote about this (well, ranted is probably a more appropriate word ;-) ) last week. I finally came across it today and see why he was so annoyed. I am revising all of my early book chapters to line up with the release version of Entity Framework. In doing so, I am going through all of the walk-throughs and one of them is to create a model from a database with about 15 tables. Some of the tables have singular names, which means that I need to edit the EntitySet names to be plural.

But some of the tables have plural names. The EntitySet names are perfect. I need to change the Entity names to be singular. That's where I see the effect that set Roger off.

I understand that if I'm creating a new entity and naming it, the designer needs to have something for the default. In this case appending "Set" is a lot safe than just appending an "s". But editing the entity name also triggered the behavior and my EntitySet names got changed as well. If I'm editing the Entity name, I most likely won't want the EntitySet name to be automatically changed.

It's surely aggravating. But all I can do in my book is point it out and explain what to do about it.

If I had a lot of tables in the database that this happened to, I'd be much more annoyed. You definitely need the designer for this because the Entity name change reverberates through the entire CSDL and MSL and you don't want to have to do that by hand.

Roger makes a great point of highlighting Huagati's LINQ to SQL & EF tool  that includes a naming tool for the model. I've had this tool bookmarked for quite a while but have been focused on my main task. Luckily Roger has taken the time to check it out (for an upcoming VS Mag article on tools for LINQ to SQL, which also includes Damien Guard's T4 template (with VB support, three cheers for Damien!!) which is also on my list, but mostly everything is on hold at this point until I get my book edits done... :-()

(okay, long sentence which went down a few roads... deep breath... back to the plural entity set names...)

So, the behavior will definitely get highlighted and explained.

IdeaBlade's DevForce has a model naming feature in it as well. Maybe they can do a community service and split that feature out as a free download! :-) Although I believe that works with their custom designer so it may not be possible.

Friday, September 26, 2008 5:21:38 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
 Thursday, September 25, 2008

I have a database hosted at ORCSWeb. As soon as I started using SQL Server 2008, I couldn't get at it from the Object Browser of SS Management Studio. I could access the database and work with it. I was just having a particular security problem with the Object Browser. When I tried to expand the list of the databases so that I could see mine and work with my db objects, I kept getting an error message that my login was invalid for someone else's database - even though I wasn't trying to access it.

Luckily, Desiree, a DBA at ORCSWeb, encountered and got to the bottom of this problem already.

Check out her very aptly titled blog post:

The server principal 'A' is not able to access the database 'B' under the current security context (Microsoft SQL Server, Error:916)

Thursday, September 25, 2008 4:53:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

IT Network Administrator

Vermont Energy Investment Corp (VEIC) is searching for a Network Administrator who will install, configure, secure, maintain and provide support for all aspects of VEIC's local and wide area network infrastructure serving our 175+ staff and sub-contractors. The Network Admin will also works with the IT Manager to plan for and manage the growth and development of VEIC’s network systems and coordinate with the IT Project Manager and Helpdesk Support Specialists to ensure quality delivery of computer support and training to VEIC’s staff. 

Requirements:

Bachelor’s degree in computer science, network engineering plus 6 years of experience managing a LAN/WAN or a combination of education and experience from which comparable knowledge and skills are acquired.

Experience with Windows Server 2003, Group Policy management, Citrix Presentation Server, Exchange 2007, and VMware Infrastructure preferred.

More info at http://www.veic.org/AboutUs/Jobs.cfm

Applicants should send a cover letter and resume to resume@veic.org by 5:00 p.m. on Monday, October 6th.

Thursday, September 25, 2008 3:14:50 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I've written a 14-page article (that's pretty long!) comparing DataSets, LINQ to SQL and Entity Framework. It's in the current issue of CoDe Magazine. Read more here...

[A New DevLife Post]

Thursday, September 25, 2008 7:46:48 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

I spent a ridiculous amount of time moving an app with lots of Crystal Reports from VS2005 to VS2008. The VS part was a breeze. It was the move to Crystal Reports 2008 that slayed me. I learned a lot of lessons during this process and wrote them into an article for ASPAlliance in the hopes of helping others have a smoother transition.

The article is Lessons Learned: Sorting out Crystal Reports 2008 Versioning, Service Packs and Deployment

Thursday, September 25, 2008 7:08:57 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
 Friday, September 19, 2008

It was a last minute scramble, but as I will be in Amsterdam for the SDN conference next month, the Amsterdam Girl Geek Dinners managed to schedule a meeting for my last night there.

I won't be doing the same talk that I am doing the next night at the London Girl Geek Dinner event.

In Amsterdam the talk will be titled:

"Staying dry while drinking from the technology firehose"

Date: Wednesday, 8 October, 2008
Time: 7-11 PM
Location: Flexbar (Pazzanistraat 1, Amsterdam)
Cost: 22.50 Euros (buffet dinner, excluding drinks)

The Flexbar is located on the Westergasfabriek terrain.

Abstract: Julie Lerman has been programming for over 20 years, with the glorious beginnings of a single BASIC computer class while acquiring a degree in Russian history. At her first job (nothing to do with history) the only computer in a company of over 1000 people quickly ended up on her desk. Since then she has used about 10 programming languages, but it took 13 years before she attended her first programming class. Julie will talk to the Amsterdam Girl Geeks about the challenge of trying to remain sane while keeping up with constantly changing technology and some of the extra challenges that being a girl geek added along the way.

 

I had a good laugh when I calculated the cost of the meeting (buffet excluding drinks, mind you) into US$.

Friday, September 19, 2008 11:37:51 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Not all CLR methods can be used when building LINQ to Entities or LINQ to SQL queries. The method needs to be something that can be expressed in the native query language. So if you have a date field, you can't use ToShortDateString in the query since there is no equivalent. You'll get runtime exceptions when you use these as the query compiler goes to work.

There are others that work, but you may not want them.

Case in point is doing a query to search on the first letter of a property.

String.StartsWith

VB

From con In context.Contacts _
                     Where con.LastName.StartsWith("S")

C#

from con in PEF.Contacts
                    where con.LastName.StartsWith("S")
                    select con

Both render this WHERE clause in TSQL:

WHERE (CAST(CHARINDEX(N'S', [Extent1].[LastName]) AS int)) = 1

I've been told this will make DBAs run away screaming.

 

String.SubString

VB

From con In PEF.Contacts _
                     Where con.LastName.Substring(0, 1) = "S"

C#

from con in PEF.Contacts
                          where con.LastName.Substring(0, 1) == "S"
                          select con

These render this WHERE clause:

WHERE N'S' = (SUBSTRING([Extent1].[LastName], 0 + 1, 1))

 

Visual Basic's Left does the cleanest job

From con In PEF.Contacts _
                    Where Left(con.LastName, 1) = "S"

Gives us:

WHERE N'S' = (LEFT([Extent1].[LastName], 1))

Other options such as attempting to use an indexer (lastname(0) or lastname

 

Be careful out there.

Friday, September 19, 2008 10:49:07 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 
 Wednesday, September 17, 2008

CoDe Magazine is based in Houston. You probably heard about Ike... a little wind, a little water. The server where the site is housed is also in Houston. So are Markus and Ellen and Cleo and many of the CoDe Magazine and EPS Software gang. Well, some people happen to be on vacation (such good timing).

But CoDe's website has been down and continues to be, in case you were looking for it. Not their fault, obviously.

When it's back up, I'll blog about my 14 page article on Data Access Options in VS2008. It's in the current issue. The one with the green cover. :-)

Wednesday, September 17, 2008 9:43:19 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

If you are not a comp-sci major, mathematician, DBA or something along those lines, there's a term in the Entity Data Model that might make you cross-eyed when you read it.

Function Name="InsertContact" 
Aggregate="false"
BuiltIn="false"
NiladicFunction="false"
IsComposable="false"
ParameterTypeSemantics="AllowImplicitConversion"
Schema="dbo">

The term in questions is "niladic". It's a math term.

"nil" meaning nothing

"adic", when combined wtih prefixes, means "having a certain number of arguments"

So combined it means having no arguments.

I'm not a comp-sci major, mathematician or DBA so I looked it up.

Wednesday, September 17, 2008 3:33:54 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Thanks to Kathleen Dollard for hooking me up with the London Geek Girls giving me somewhere to go and something to do with myself in the 3 days between SDN in Amsterdam and DevReach in Bulgaria!

I'll be heading to London for the interim and speaking at the 3rd Anniversary of the London Geek Girl Dinner. I'm so looking forward to this because I get to talk about being a geekette and don't have to write a lick of code. The geek girl dinner's are non-denominational, so to speak, crossing over many technology areas. It's a coincidence that this month's meeting will be at the Microsoft office. The fruit just does not fall far from the tree, does it? :-)

Here's the abstract for my talk.

Julie Lerman: “Defining the –ette in Geekette”
Twenty years ago, Julie Lerman learned that she had to act and dress like the guys in order to fit into the IT Industry. Today she’s found that the cover-up is no longer necessary. Many of her “girly” qualities have become advantageous in a world of geeks where she now speaks at conferences all over the world and has just finished writing her first programming book for O’Reilly Press. Julie will share with the London Girl Geeks some of this historical perspective and lessons learned.

But wait there's more. I'm going to be in pretty intellectual company! The other speaker for the evening is Dr. Elisabeth Kelan who is a Senior Research Fellow in the Lehman Brothers Centre for Women in Business at London Business School (http://www.london.edu/womeninbusiness.html). (I sure hope that Centre was endowed for the long term! :-( ) Elisabeth will be presenting on research she has done on gender proportions (such as the oft-quoted percentage of IT workers that are women (it's 10% if you were wondering)) and gender stereotypes in the workplace.

I've heard these gatherings have upwards of 150 GEEK CHICKS. I am SO excited to be able to participate in this. I'd be thrilled just to be a fly on the wall, much less an attendee or even a presenter. Thanks to Microsoft for sponsoring this large meeting.

For my other two days, I plan to wander around the V&A (you can find me among the glass, ceramic and armor collections oh and maybe the tapestries and well, so much more...) and consume tea & scones.

Wednesday, September 17, 2008 12:18:00 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  |