Daily Archives: November 20, 2007

Fix XML encoding in LINQ to SQL files to open up in RTM designer window

When opening a dbml file created in a pre-RTM version of Visual Studio 2008, you will probably see this error message:

Cannot load ‘[filepath].dbml’: Error encountered, check Error List window for details.

Looking in the error list window, you might see the following errors:

Build failed due to validation errors in [filepath].dbml.  Open the file and resolve the issues in the Error List, then try rebuilding the project. 

and

There is no Unicode byte order mark. Cannot switch to Unicode.

Opening up the dbml file in the XML editor, the intellisense does not point out any validation errors.

 I couldn’t see the problem.

Then I created a new LINQ to SQL file and looked at the xml,noticing that the encoding was:

<?xml version=1.0 encoding=utf-8?>

while the old file had

<?xml version=1.0 encoding=utf-16?>

So I modified the old file changing the encoding to utf-8 and voila, my project compiled and the file opened up in the designer.

Paper books – from my cold, dead hands

Last week, I was fortunate to have dinner with Rick Chapman, author of In Search of Stupidity, who had come to Vermont to speak at the monthly meeting of the Vermont Software Developer’s Alliance.

Rick is an software marketing guru who also author’s the Softletter newsletter for software company business owners. He is also someone who does a lot of trend analysis.

During our dinner, the conversation shifted to e-books. Rick is sure that e-books, when the devices reach the right form factor and functional features, will replace books. I said,”No way. I love books. You’ll have to take them from my cold dead hands.” (Very creative of me, eh?)

He couldn’t be convinced; but I know I love books. I know I love it when I get to add the latest read to my bookshelf. I love reading in bed and I love carrying a book with me when I travel. One argument of his was “aha – so how many books can you carry on a plane? Wouldn’t an e-reader be better?” My reply was that it didn’t matter because I can’t read that fast anyway. One book will usually suffice for a plane trip.

I love the different fonts that are created for letter presses. I love the varying quality of the covers and the paper. I love the feel of the paper.

It’s probably why I also always enjoy Charles Petzold’s many posts about his books. Today he wrote about digital vs. paper books and wondered about wanting to re-read a book after a decade or two. If it’s digital, what are the chances of the original technology/format that the books was delivered in still existing, or the device still even working. But if it’s a book on his bookshelf, no problem. Just pull it out and read it. Maybe a little dusty, perhaps some yellowed-pages, but there for all time.