Thursday, March 22, 2007
#
Ziff-Davis has consolidated this blog with all of the other ZD blogs. This means a number of things. This blog (which uses and old version of .Text) is going to stay here as an archive, as we can't easily move all of the existing posts into the new blog.
We have also turned off the ability to leave comments on this blog because the comment spam has gotten horribly out of control. The downside of this is that in this version of the blogging software, turning off comments also means no comments at all are displayed - even good ones. I hate to lose the context of the discussions, but we have no choice.
The new blog is at
http://blogs.devsource.com/devlife/
Also, visit the new blog of DevSource editor Jeff Cogswell at

http://blogs.devsource.com/msdev!
Wednesday, March 21, 2007
#
I just discovered ClickOnceMore, so recently that I haven't had a chance to try it out yet and won't get to for many days. So I am presenting this cliffhanger. Will ClickOnceMore solve my ClickOnce deployment troubles that require a 15 step process that I literally have to return to my previous post for a checklist when I have to do my deployment.
(Note: You may notice gobs of dreadful spam on that old post. We are working on scrubbing them all off of the blog and the turning off the comments. I'll be moving to a new blog soon soon soon.)
Many have suggested that I just create an MSBuild file for this, but I just haven't tackled MSBuild yet.
This tool looks very promising. Stay tuned...
Monday, March 19, 2007
#
Mike Taulty has two excellent posts on understanding how LINQ to SQL works, the difference between IEnumerable<T> and IQueryable<T> and more. While some people prefer to just follow the examples and use it, there are plenty (like me) that want to understand what's going on underneath. This makes planning and troubleshooting much simpler as well as sates our inherent “why is the sky blue” curiosity!
Deconstructing LINQ to SQL Part 1
Deconstructing LINQ to SQL Part 2
I was also relieved to read that someone with his mind also has a hard time with posts like the one where Matt Warren from Microsoft explains the same concepts. Matt is very close to the technology and is able to make a lot of leaps of understanding and I definitely have to read those types of posts over a few times and hurt my head a little before I get to an “aha!”. Mike has done a great job of translator.
Sunday, March 18, 2007
#
Rebuilding my development machine on Vista last weekend meant installing a lot of development tools (in addition to Visual Studio 2005 with SP1 plus the SP1 for Vista and SQL Server 2005 with SP2).
In the pile are some collaboration tools that I use on various projects.Here's how some of those fared:
SourceGear Source Off Site: Installed and working with no problems
SourceGear Vault v 3.5.1: Incompatible, but there is a new version (3.5.2) in the works and you can get the Beta (which I'm now using) by checking this forum post. I've been using the beta with no problems.
Innovasys HelpStudio 2.0: No problems though there is a v3.0 coming.
Visual Source Safe 2005: No problems
Cisco VPN Client: Incompatible, but again, there's a beta out there and thanks to this post Bill Evjen's blog , I was able to find it. That is working fine so far. I just have to remember to look for the actual release. Interestingly, someone from Cisco turned the comment section of Bill's post into a support site and I see that yesterday, he wrote that they will be posting the RC version tomorrow (Monday). Cool. Here's the main VPN Client page on their site..
Friday, March 16, 2007
#
An interesting thing is happening in the ADO.NET Orcas forums. The hard questions are really starting to come out. People have been playing with Northwind and getting familiar with the basics of EF long enough and have begun testing their own data access and modeling needs and theories against it.
The ADO.NET team has been right there answering questions and engaging in some interesting conversations as well as followgin up with some blog posts.
Some very interesting recent topics have been:
Stored Procedures: Theres a post in the ado.net blog abot how to implement sprocs in the EF. While this is great to have (and necessary because it's not very discoverable and the documentation doesn't exist yet in the MSDN docs that came with the new CTP), John Papa points out one toughie with the methodology. There's a database level tweak required to sprocs that you want to implement in the framework. John also cleverly refers to this functionality as “CUD” because it's for change processing, but not Reading. Living in a state where there are a lot of cows, I thought CUD was pretty funny.
Persistence Ignorance: Okay, this is another one of those “comp sci major” terms. (Remember, I was a history major.) Again, a fabulous discussion in the forums. The question was in two parts - first was the necessity to subclass the entity framework classes rather than just inherit from them. According to Danny Simmons from Microsoft, they are currently working on changing this and we should see a new twist in a future CTP. The second was about the current requirement of attributes to define entities at the class level. Danny addresses this as well. Great converastion here.
Inheritance in the EF: It is possible to inherit from entities. Erick Thompson explains and demonstrates inheritence in this blog post. While much of the focus of the conceptual layer is about not touching the db, Erick demonstrates how the Entity Framework's flexibility can handle when the database changes.
Realizing the Conceptual model by flattening data: While the EF can map an entity across two tables, it can currently only do so when the tables have a one to one relationship. What if you want to flatten data? This is the question posed in this forum thread. If we have data availabel in a child object ((eg Product.Productname and Producut.Categories.CategoryName) and want it to be a property of the parent object so you would end up with Product.ProductName and Product.CategoryName, how can you achieve this in the Conceptual layer without mucking with the database (eg creating a view). The answer is that right now you can't. But a number of folks on the team weighed in and again, it was very educational for me.
New ideas bubbling up.
Map a DataSet Schema to an Entity Schema: Earlier this week, I did a presentation on EF at the TechValley.NET in Albany, NY. There was a smart bunch of programmers who challenged me with some quetsions I just couldn't' answer. One of them was Griffith Townsend who asked about doing this. Rather than theorize, I suggested that he post the question in the forums, which he did. I look forward to seeing how this conversation goes.
Extending the CodeGen capabilites of EF: This was a secondary question in this thread. More interesting reading.
NEW SAMPLES!! The Linq to Entities samples (C# only still) were added to the 101 Linq samples download. Get it here. I built a cool little CRUD demo for my Albany presentation that uses LINQ to Entities. I'm thinking about doing a Camtasia video of it.
Roger Jennings continues to do some great analysis of many of the above issues educating me (and many others, I'm sure) with his broad perspective.
Monday, March 12, 2007
#
Even if you are using an admin account in Vista, this may not be enough for application's which require that you install as an administrator.
Right clicking on the installer (e.g. an msi) file does not give that option.
The solution may be obvious to some, but it wasn't to me!
Open up the command window as an administrator (in other words, right click on the command prompt icon and choose Run as Administrator). You'll get the UAC prompt (Windows needs your permission to continue doing the thing that you just asked it to do.) and continue. Then you can launch your installer from the command prompt.
Sunday, March 11, 2007
#
Many of you may have noticed that the current software used for this blog, a very early version of .Text (which evolved into Community Server), has left me nearly defenseless against enormous amounts of comment spam. Without turning off the ability for readers to comment, I have to attempted to delete hundreds of new spam comments per week but have been unable to keep up.
We are finally getting an updated blog, but in order to bring my blog inline with the other Ziff Davis blogs, it will be moved to a new blogging engine (Movable Type). Therefore, this version of the blog and its contents will stay in tact at this url, but I will turn comments off so that no more spam can be added. The new blog will be at a new url and will begin with the new posts. I will be sure to make obvious links on both blogs so you can find the new from the old and vice versa.
Saturday, March 10, 2007
#
Today I am doing Vista installs on not one, but two machines.
The first is my new Lenovo X60 Tablet (my first Thinkpad ever!) which actually had Vista on it when it arrived. I have been busy installing Microsoft Office 2007, VS2005 with SP1 and the Vista SP1 as well. Because of the Vista install, I had lost all of the built in ThinkPad software, so I'm installing that as well. I'm really excited about this machine - Duo Core, tablet, outdoor display and even touch screen (yes, with my finger! and I have only tried it out minimally, but it's pretty cool.).
But that's the minor job. The big job was updating my Dell Ultra SX280 which originally came with a 40GB drive. This is a very small footprint pc, so had room for only one drive. I used this as my test machine for Visual Studio 2005 (back when we called it Whidbey) through it's alpha and beta stages. Then I repaved it when VS2005 was released and have been using it for all of my VS2005 development since - leaving my other box with some old VB6 and other apps independent.
Because I wanted to move this machine to Vista, I purchased a 300BG drive whch has been sitting in the corner of my office unopened for a few months now. Before doing this job, I wanted to be sure I could still use the existing pc in an emergency. After some research, I learned that Acronis was a great backup system that would also allow me to restore the backup image into a VPC (this requires the Universal Restore add-on with the TrueImage product). While the backup was easy, it took me a while to figure out how to restore into the VPC because I had thought that I needed to backup TO a VPC, and never looked at the various restore instructions. Finally, Michael Campbell set me straight (yet again) about the basic steps I was missing, and I was on my way. I will write up a separate post about that process. But pushing the entire image into a VPC and using the tools from Acronis to do this turned out to be a great solution.
Once I had confirmed that I was able to boot up into the VPC and that my existing system was totally in tact within that VPC, I was ready to turn the box into a Vista computer. It already had 2GB RAM in it and the video card (it's a DVI system) was supposedly ready to support Aero, so I didn't feel quite like the poor PC guy in the Apple ads where he's on his way to the hospital. (I feel so guilty laughing at those ads, but who can help it?)
But my big mistake - or was it? Before doing this I researched the Intel 915G chipset display adapter and came away confident that I would be able to get Aero. This is a slick, fairly new video card. But I couldn't get Aero working and found a few forums with people typing in all-capital angry letters about Intel not supporting Aero on this chipset. Finally I found this confirmation from Intel, which I am surprised I didn't find before. So perhaps, I will have to don a hospital gown, serve up some jello and fork out some cash for a new adapter card after all. Uggh. Luckily resellers like TigerDirect have a way to find Vista compatible graphics cards - remember, though that you want not just Vista, but Vista Aero.
Flipping drives was easy. And doing the installation of Vista simple and quick. What a difference from previous version of Windows. I was able to partition the drive into three 100GB drives as part of the install - very intuitive.
Now I still have to install a LOT of software - besides VS2005 and Office, all of the other tools and 3rd party tools that I use in the course of my development. I will still use my Windows XP computer for my daily life (email, writing, etc) for the time being (or p - as there are hundreds of applications on there and I have no intention of rebuilding that and I also truly believe in repaving and cleaning up a system for an O/S upgrade.
So back to it, since I really had a bunch of real work to do today, but this is a very fun distraction.
Monday, March 05, 2007
#
The March CTP (Community Tech Preview) of the next version of Visual Studio (code named “Orcas”) was released last week. See my previous post for links to get the download.
After I finally got the humongous VPC downloaded and installed, I have been working in it non-stop; focusing on Entity Framework in ADO.NET and LINQ to Entities and LINQ to SQL. I am just bringing my head up for air and wanted to share some of the great discussions and resources that I have found useful when working with all of this.
LINQ to SQL
The “101 LINQ Samples“ Solution (which is really a LOT more than 100) has been updated along with a bunch of other LINQ Samples (all of this is in C#, still waiting on VB). Charlie Calvert posted them on his blog. They did not make it into the CTP. For a quick and very helpful video introduction of what's in there, see the second blog post.
http://blogs.msdn.com/charlie/archive/2007/03/04/samples-update.aspx
http://blogs.msdn.com/charlie/archive/2007/03/05/march-ctp-samples-overview-video.aspx
Mike Taulty has been writing some great posts. Here are a few of them, but cruise around all of his newest posts for more goodies.
LINQ to SQL Object Tracking and Turning off LazyLoading
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/03/02/9142.aspx
LINQ to SQL Stored Procedures (C#)
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/03/03/9145.aspx
I wrote a related post with VB code
http://www.thedatafarm.com/blog/2007/03/05/StoredProcsInLINQToSQLInMarchCTPTheVBVersion.aspx
Join problems that stemmed from importing previous CTP code into the new CTP. This carried over some earlier DLLs and gave me wierd problems with joins in C# and VB. Jim Wooley came to my rescue. Here's the forum thread. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1300672&SiteID=1
LINQ to DataSet
Disappearance of ToDataTable and LoadSequence (allowing you to create a DataTable from [I think any LINQ] query result) seem to have disappeared (one of Mike Taulty's post is a hack to make up for it) but CopyToDataTable is in there for LINQ to DataSet. The query result of a LINQ to DataSet query is DataRows and CopyToDatatable can merger those DataRows into a DataTable. There are some examle of this in the LINQ Smaples on Charlie's blog. Here's a forum thread where it was discussed.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1300671&SiteID=1
Problems with AsEnumerable? I had a dreadful problem with DataTable.AsEnumerable (makes a DataTable queryable). Luckily I found this great post from Angel Saenz-Badillos (who used to save my butt on Query Notification problems!) where he described the problem and at the bottom of the post, reveals the cause which was not having references to the correct DLLs. Note that in this CTP, these DLLs are not in the GAC. You have to go into c:\windows\microsoft.net\framework\3.5.20209 to find them.
http://blogs.msdn.com/angelsb/archive/2007/02/23/does-not-contain-a-definition-for.aspx
Entity Framework
gone. The docs are updated and explain how to add constraints to Entity properties beyond the simple facets using but the docs are wrong. Check Constraint does not exist. Too bad!
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1301414&SiteID=1
Primary Keys which are also a Foreign Key
When building schemas with the wizard, if you have a primary key on a table and you are also using the primary key as a foreign key to another table, the pkfk relationsihp won't get added into the storage schema. Here's an explanation.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1287163&SiteID=1
Many to Many Mapping in EDM
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1285818&SiteID=1
Object Services & Stored Procs
Bob Beachemin created samples for doing Sprocs within Object Services.
http://www.sqlskills.com/blogs/bobb/2007/03/04/UsingStoredProceduresWithEDMObjectServicesInTheMarchCTPWithCode.aspx
Entity Framework Terminology
There is a lot of great stuff in the docs in the CTP. John Papa surfaces a goodie:
http://codebetter.com/blogs/john.papa/archive/2007/03/03/Entity-Framework-Terminology.aspx
Blogs:
Here are recommended blogs of people who are banging furiously on these areas of these new bits. (I'm sure there are more, but these are where I've been lately)
Roger Jennings
Bob Beauchemin
John Papa
Jim Wooley
And always watch:
ADO.NET Team Blog
Data team blog
ADO.NET Orcas Forums
LINQ Forums
Wednesday, February 28, 2007
#
While I'm desparately trying to download the newest bits of Orcas on my slow-and-getting-slower DSL, the ADO.NET Team is torturing me with some new posts on the Entity Framework. (Here are the links, but don't go downloading until I'm finished. Note that theres a VPC download and an MSI download.)
The first blog post shows populating an RSS feed with data coming from the Entity Model. This is a perfect fit for me since I have played a bunch with the RSS Toolkit (as well as wrote an article on it for aspNET Pro Magazine) and have been heads down in the Entity Framework lately.
The second post (which disappeared while I was writing this post - but I expect it will reappear shortly.. just watch blogs.msdn.com/adonet!) addresses one of the biggest questions about querying against the Entity Framework - what are the pros & cons of Entity SQL vs. LINQ. In discussing this, the post also lays out a lot of great background info.
The first thing people notice about Entity SQL is that it's a string and that you can't [currently] do DML with it (meaning that you would have to query with eSQL and then update with LINQ or an object context. And many quickly dismiss it because LINQ enables strongly typed querying and you can retrieve and post data with the same set of objects.
There are a lot of choices and the bigger picture is that all of these tools will evolve. Entity SQL has the advantage of flexibility as well as familiarity for programmers who wish to do ado.net type data access (connections, commands, execute, etc), when using the EntityClient with Entity SQL. (Although, yes, the DML is still an issue.) Entity SQL is also available for people using languages that aren't spelled “VB“ or “C#“.
Either way, it's a lot of new interesting stuff to learn. The ADO.NET team has been writing some great posts about Entity Framework on the team blog and the data blog.
I think the most important thing (which scares some people) is that we have a lot of options. As long as those options come to the table with guidance, it's a great scenario. Programming is not a one size fits all arena. I like what ADO.NET is becoming.