Rocky Mountain Tech-Trifecta : A Week Later

It’s been a week since the Rocky Mountain Tech-Trifecta and I’m still getting caught up and processing everything that I learned there.  I presented a couple sessions and I also attended a bunch of sessions.  Fun stuff.  I think the event was huge success.  Thanks to my employer Colorado Technology Consultants, Inc. for letting me spend so much time volunteering for the event.  A special shout out to Julie Yack for all the time and effort she put in.  Please visit her blog at http://julieyack.blogs.com for a couple cool pictures from the event as well as some fun facts.

As stated above, I did two sessions at the Tri-Fecta.  The code and slides are below.  Please email me any questions or comments to benh@coloradotc.com.  You can also catch up with me on Twitter.  My handle is benhnet.

Thanks again to everyone that volunteered, organized and attended.

LINQ : DBA vs Developer

Design Patterns For UX

Updated 3/3/2009: I forgot one of the projects being referenced in the Design Patterns for UX.  I have updated the link so please download the project again and it should work.

Rocky Mountain Tech-Trifecta – Less than one week away

For those of you in the Rocky Mountain area we are one week away from the Tech-Trifecta in Denver.  In case you live in a cave, the Tech-Trifecta is a free event including three tracks:  .NET Development, SQL Server and Windows.  If you have not registered please do at www.rmtechtrifecta.com.  In case you didn’t know the speaker and topic schedule has also been updated.  We have some unbelievable stuff going on.  I can’t believe this is a free event!  Please join us.  I will be speaking there as well and I hope to see you.  If you can’t make one of my sessions, please stop me in the hall or atrium and say Hello.

Also, I am organizing a Skiing\Boarding day at Copper Mountain on next Sunday the day after the event.  Anyone is welcome but please register for that event as well so we know how many discounted tickets we will need.  The link to register for the Skiing\Boarding event is also on the Trifecta site.  I am looking forward to the Trifecta, but I’m also looking forward to blowing of some steam the day after.

Posted in | 0 comments

Silverlight is the Future?

Just wanted to pass on this link to a post from Rocky Lhotka.  He describes why many of his new projects are starting to favor Silverlight over ASP.NET and Win Forms.  It’s a quick read and gets you thinking.  Check it out:

http://www.lhotka.net/weblog/WhySilverlightIsTheFuture.aspx

Posted in Labels: , , , , | 1 comments

More Windows 7 Info

I came across this Windows 7 informational site yesterday on Gizmodo.  They have some great tips and tricks and also walk you through the installation process.  I’m sure there are more sites out there related to Windows 7.  Anyone have any others I should check out?

Posted in Labels: , | 0 comments

.NET Events in Colorado

I know January is almost over, but to me the year is still new.  I wanted to inform everyone about all the awesome User Groups and Community events in Colorado.

One of the most exciting upcoming events is the first ever Rocky Mountain Tech Tri-Fecta on Saturday, Feb. 21.  I cannot explain how cool this event is going to be!  It’s basically an all day geek fix.  There will be sessions related to .NET development, SQL Server and Windows Server.  So, if you work with MS products or know someone who does this is the event for you.  We have tons of speakers (Scott Hanselman is coming!) from all over the country and many who work for Microsoft and have inside info you cannot get anywhere else.  If you like what you are hearing please be sure visit the www.rmtechtrifecta.com site to register for the event to reserve your spot.

Next I wanted to let people know about the South Colorado .NET User Group.  I have taken over the leadership of this group from Julie Yack.  Julie Yack, David Yack and David Milner round out the leadership team for this group.  Next Tuesday we have Kathleen Dollard coming down from Ft. Collins to talk about rethinking Object Orientation.  SHould be great!  Please check out the link above to get more details.

Here are the links to all the MS related user groups I can think of in Colorado.

Denver Visual Studio User Group

North Colorado .NET User Group

Boulder .Net User Group

Colorado Springs SQL Server User Group

Denver SQL Server User Group

Colorado Springs Windows User Group

Rocky Mountain Windows Technology User Group

Please let me know if I missed a group.

Windows 7 Beta Stability is Solid!

I took the plunge last weekend and loaded the latest Windows 7 Beta on my laptop.  I decided to just go for it.  I had already loaded it on a spare laptop from work, but until you use something on a day to day basis you don’t really get a good feel for it.  Overall the experience has exceeded my expectations.  Here is a list of things I like:

  • The most impressive thing was the easy of installation and driver support.  I have an AMD Turion 64 X2 laptop.  The laptop was loaded with Vista 32 bit.  I decided to go all in and load the 64 bit version of the Beta.  Install was clean and the first time I logged in my screen resolution was really low.  However, after the first login Windows Update ran automatically.  Once that was done and I restarted the machine and was happy to find that my video and audio where back to normal.  I’ve been running for 5 – 6 days now smoothly and without a crash.
  • Another thing I have been happy with is the power management.  I have three kids under the age of 6.  So, I like to move around with my laptop while I keep one eye on them.  The power on my laptop seems to last longer without sacrificing connectivity or performance.
  • Next, The new task bar is really useful.  Instead of having multiple entries in the task bar for every window, Windows 7 groups them by application.  This is big.  For example when I’m using Outlook I frequently have multiple messages along with calendar entries, contacts etc open at once.  Windows 7 shows one icon on the task bar.
            • image
  • Then when I hover on that icon it expands and shows all the windows opened related to Outlook.
            • image
  • Very Cool!

A couple things I don’t like so far.

  • Support for multiple monitors is a bit difficult.  Maybe I just need some time to get used to it, but it took some extra clicks to get my second monitor configured.  I also had to save my settings multiple times to get it to work.  Not a big deal, but kind of annoying.
  • I also was disappointed that there is not support for mounting ISO files built into the OS.  Also MagicDisk, which is the one I used on Vista, did not work.  I found tons of blogs on this and finally loaded PowerISO.  PowerISO worked fine, but the fact that this took so long bothered me.

I will post any other things as I come across them, so far I’m running without a hitch.  The bottom line is that if you are thinking about trying it I would recommend it.  It is beta software so buyer beware, but so far this buyer is very satisfied.

Posted in Labels: , | 0 comments

Silverlight Path Resolution

First let me explain path resolution.  I have an image I want to use as my XAML button.  Easy enough I add an Image control to my Control Template for the button and set the source to the path of that image.  Path resolution is how the compiler determines where that image is.  I could hard code it to a directory on my hard drive, but that is never good because that path could change between environments or client machines.  So, most times we use relative paths.  Combinations of  ".." and slashes help us navigate the application structure to find the files.

Path resolution in XAML can be hard to understand.  It get's even more complicated once you add Silverlight to the mix.  Then on top of that when you are using User Controls from a Silverlight User Control Library things get down right nasty!  Then add in some shared Control Templates and things get darn near impossible.  That is the scenario I'm in.  I ran across this article which helped me get it working.  Check it out.

http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/03/09/Silverlight-2-Beta-1-Path-and-File-Resolution.aspx

One important thing to note is how you must mark the properties on the images.  Depending on how you are going to access the files you have to either set the Build Action property as "Content" or "Resource".  You might also need to set the Copy To Output Directory property to "Copy Always".

Another thing to note in my case is that if the Control Template is a shared\application level template, the images must reside in the application project, not the control library.  The path used in the shared Control Template is related to the application not the control library.

The most important thing is to pick a one way and stick to that throughout the application.

Posted in Labels: , , | 1 comments

XAML Data Binding Slides and Demos

Last night I presented at the South Colorado .NET User Group.  The discussion started with XAML data binding basics and then went into some more advanced topics.  I basically covered how to bind to any back end data source I could think of including the ADO.NET Entity Framework.  I also covered some style and UI topics.  It was a fun discussion and I think my point regarding the power of data binding in XAML and WPF was made.  I have uploaded a zip file of the slides and demos.  The link is below:

http://www.htechinc.com/files/XAML%20Data%20Binding%20With%20WPF.zip

I also mentioned a cool add in for Visual Studio called XAML Power Toys developed by Karl Shifflett.  Here is the link to XAML Power Toys:

http://karlshifflett.wordpress.com/xaml-power-toys/

If you have any questions regarding either of these links please let me know.

.NET Framework 3.5 Enhancements Training Kit and AJAX History

I've been meaning to blog about this for awhile now.  If you have not checked out the .NET Framework 3.5 Enhancements Training Kit, you should.  It has documentation and tutorials on the cool new features in the 3.5 Framework including: ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX History, ASP.NET Routing, ADO.NET Data Services, ADO.NET Entity Framework, WCF 3.5 SP1, and the .NET Framework Client Profile.  You can download the training kit here.

One enhancement that we are interested in at work is the AJAX History enhancements.  This is cool because it enables AJAX to use browser history.  In the past when you used AJAX to do a post back on a section of your web page, that post back was not captured by the browser history.  So, users could not use the back functionality of their browsers to get back to before the AJAX post back.  The new AJAX History features allows us to configure the page to use browser history.  It's pretty easy so if your interested just download the training kit and walk through the tutorial.  It takes 15 - 30 minutes and you will be ready to go.

Enjoy!  Let em know some of the cool stuff you find with the training kit.

Entity Framework And Tables With No Primary Keys

OK, I think we can all agree that having tables without primary keys is a bad idea.  However, sometimes we are forced to use backend databases that have multiple design flaws.  In fact, database design flaws are one of the very things the Entity Framework (EF) can fix.  EF allows us to fix issues we find in a database without actually effecting the database schema at all.

Anyway, yesterday I added a table to my EF model that had no primary key.  I was surprised to learn that EF decided that since there was not a primary key it would just use all the non-nullable columns as a concatenated primary key.  This might not be what you want.

To fix the issue, I had to hack the XML and remove the keys from the table definition.  I was not able to fix it using the UI in Visual Studio 2008 SP1.  Instead, I had to right click the model file in the solution explorer and select "Open With...".   From there select the XML Editor.  Then you just need to find the table definition and remove the unwanted columns from the primary keys section.  It's a bit of a pain, but it is the only fix I know of at the time.

Let me know if you find a better solution.

Virtual Conference Day 3

Today was another great day at the vConference.  I attended some great sessions over the course of these three days and now I'm excited to go back and watch the ones I missed on demand.  I hope everyone had as much fun as I did with the conference!

I did finally get my hosting situation figured out.  That means I can get my slides and demos out here for people to download.  I do believe that the vConference site will have this stuff posted eventually, but in case they don't here you go:

SharePoint:

Business Data Catalog Part I

Business Data Catalog part II

KeyNote - SharePoint and SilverLight

.NET:

Beginning WPF Databinding

Advanced WPF Databinding

Design Patterns

KeyNote - Data Services

KeyNote - SilverLight and Cross Domain Calls

KeyNote - LINQ vs. ADO

Virtual Conference Day 2

Day 2 of the conference was just as good as day 1.  We had great sessions all day long.  I attended a bunch of the sessions and had some great conversations with many of the attendees.  One of the issues we ran into today was the demos where not available.  I was going to post them here, but I'm having some issues with my ISV and getting the files to the server.  I will post them ASAP.

In the mean time, enjoy the rest of the conference.

Virtual Conference Day 1

Day one of the Virtual Conference is over.  It was a good day.  We had dueling Dynamic Data Presentation going on from David Yack and Rachel Appel.  If you missed one go to the on demand section of the conference and watch the other.  After  watching both of these sessions you can become an expert on Dynamic Data.

I also attended many of the other session.  Rob Bagby did a great Rest session and Scott Golightley did an awesome WCF session.  Kathleen Dollard gave two great sessions and Tim Heuer got us started with SilverLight.  Not to mention a killer Keynote delivered by yours truly.

And all this was just the .NET Conference. 

I also delivered my two sessions on SharePoint and Line of Business applications.  These were with the SharePoint conference.  Again, if you missed it please check it out on demand.  If you have any questions please direct them to me.  I'd be happy to help.

Tomorrow I deliver my two sessions on WPF data binding.  Please  check them out.  It's also not too late register and attend.  You would also get access to all the on demand sessions from day one.  Here is the link to the registration and my discount code.

Enjoy!

PDC is awesome but... Don't forget the Virtual Conference next week.

The PDC is a great place to get the latest news related to Microsoft Technologies.  It's a good idea to keep up to date with what is going on in the world of Microsoft.  However, most of the stuff released and demoed there is bleeding edge stuff that won't be available for live deploys for months or even years.  That's where the SSWUG.org Virtual Conferences being held next week come in.  Three days of great content, most of which can be used in the applications you are building right now and can be deployed TODAY!!!  Four conferences are being held that include: SQL Server, SharePoint, .NET and BI.  Not only is it great content, but's it's only $100!!!  Or if you use my discount code you can get it for $90.  My discount code is:

SPVIPBH

Please use this code to save yourself $10 and go have a burrito at Chipotle on me.  Mmmmm Chipotle.......

My Business Data Catalog Session

I have been recruited by the Star League to defend the Frontier from Zur and the Kodan Armada.  (Let me know if you can name the movie that is from)

Actually, I have been recruited to do a couple SharePoint sessions at the SharePoint Virtual Conference.  My main exposure to SharePoint has been using the Business Data Catalog.  So, I'm doing a two part session on the topic.  If you are a SharePoint user, administrator and\or developer you can't miss this conference.  Some awesome content for only $100.  Here is the link to the conference home page:

SharePoint Virtual Conference

.NET Developer Virtual Conference - Update 9/30/2008

Just wanted to update everyone on a couple of things related to the .Net Virtual Conference.  In my previous post, I explained the idea of the conference and discussed all the great content that is available.  In these hard economic times, getting access to this type of content for $100 is a great opportunity to save some money without compromising the bottom line.  Well, things have gotten even better!  Announcing a change to the .NET Developer Virtual Conference.  Now the .NET Developer Virtual Conference also provides access to the SharePoint, Business Intelligence and the SQL Server virtual conferences.  Read the details here.  Now you pay the same price ($100) and get access to over 120 session.  Pretty awesome.  PLEASE NOTE THE DATE CHANGE FOR ALL CONFERENCES.  THE CONFERENCES WILL NOW OCCUR ON NOV. 5th, 6th and 7th.  Here is the registration link.  Do not miss out on this opportunity to be in the know!

On a personal note I recorded my sessions last week and I think they went pretty well.  My WPF talks are not the flashy, shiny WPF sessions you've seen in the past.  These sessions will help you with the actual guts of doing a useful WPF application.  Leave all that flashy, shiny stuff to those artsy designers and their black turtlenecks.

I was also subjected to an interview that was posted by Chris Shaw.  If your interested in my answers to the tough questions in the interview please click here.  Please do not be scared away by my ugly mug at the top of the article.  If you look around on Chris Shaw's blog you will find some of the interviews with the other presenters.

Method Error 500 and AJAX

I'm using the cascading drop down provided by the AJAX control toolkit.  I started getting a "[method error 500]" in one of my drop downs a few months ago.  At the time I thought it was bad data and after I removed some of the dups all was fine.  Well, the problem came back recently and I determined all the data was accurate.  So, I began debugging through the problem.  After I got some more details from Fiddler and debugging, I was able to find this post that fixed the issue.  Kudos to Simon Harriyott.

My work here is done.

Posted in Labels: , | 0 comments

Using Fiddler To Debug Locally

Fiddler is an invaluable tool for seeing what is actually being sent over the wire in your web application.  Fiddler runs without issue when using it to track chatter that is occurring over the normal HTTP channels.  However, it will not log traffic when running your ASP.NET application in debug mode locally.  There is an easy trick to fix that.  Here is the post that describes the fix.  Enjoy!

Now play that Fiddler boy and give the devil his due...  When are they going to release the Golden Fiddler?  (Sorry for the "Devil went down to Georgia" reference.  I just couldn't help myself)

Posted in Labels: , | 1 comments

.NET Developer Virtual Conference : Oct. 28 - 30

Just wanted to let everyone know that I am lucky enough to be a presenter at this years SSWUG.org .Net Developer Virtual Conference in October.  This is a really cool idea where all the sessions are pre-recorded and on the days of the conference you can login and watch from the comfort of your ergonomically correct cubicle chair.  Maybe you can talk your boss into giving you the days off and you can watch in your PJs from your couch.  Either way you don't have to incur the time or the cost of traveling to an in-person conference.  This is a plus for those of you that are "Dungeon" coders.  You can get all the great content of the conference without leaving the "Dungeon" and being forced to socialize with other people.  That can be uncomfortable...

Seriously, there is some great content from some of the top presenters in the industry on deck for this conference.  I'm just glad I get a free login so I can attend some of the other presenters sessions.  Speaking of cost, you get all three days for just $100.  If you can't sell this to your boss you're never getting any training EVER.

Again there are some great topics and presenters so please use this link to check out the sessions and the presenters for this conference:

.NET Developer Virtual Conference

There are also 3 other Microsoft related virtual conferences scheduled for the fall.  Use this link to find out about all the conferences from SWWUG.org:

www.vconferenceonline.com

David Yack's CRM as a Rapid Development Platform Book

Don't let the letters "CRM" in the book title fool you, this is a book heavy on content regarding the latest .NET Framework technologies.  Microsoft Dynamics CRM version 4.0 is a great CRM tool, but it can be used for much more.  That is the purpose of this book.  To inform the developer community about the benefits CRM 4.0 gives you right out of the box along with the many customization points that allow you to turn the product into literally any line of business application you want.  Not only do you get great content in the book, but when you purchase the book you also get a base framework built on top of CRM 4.0 to get you up and running fast.  This book has tons of great real world examples of how to use Workflow, Silverlight and C#.

Being a friend and co-worker of Dave's, I've been a witness to all the hard work and long hours he put into writing this book and creating the base framework that comes with it.  I've also seen all the hard work and support given from many of Dave's friends, family and co-workers.  One person who is all three of these things to Dave is his wife Julie Yack.  She was editor and publisher on the book.  She spent many hours reading through and editing long chapters that included tons of code and examples.  Another friend and co-worker, Cathy Hardman, also put in long hours helping edit the technical content of the book.  In addition, she helped write many lines of code included in the base framework as well as contributing her talents to the book web site.

Me, I helped edit a couple of the chapters, but most of the process I watched from the sidelines.

Obviously, I recommend the book and since I know "people" I have a discount codes for purchasing the book.  Below is the URL to the book site where you can purchase the book and my discount codes.  The codes are good for $10 off.  The discount codes can only be used 20 times so please hurry.  Enjoy!

Book Site: http://www.thecrmbook.com

Discount Code (Printed Version): benblog

Discount Code (E-Book Version): benblogebook

You can also keep up with David Yack at his two bogs.  Developer Related stuff is at http://blog.davidyack.com/ and his CRM stuff is at http://crm.davidyack.com/.

Posted in Labels: , , , | 1 comments

Jeff Atwood on Project Management

I had to share Jeff's recent post related to project management.  To me managing a software project is one of the hardest jobs out there.  Especially when it comes to evaluating your team members performances.  Some team members write tons of lines of code, while the architects that really designed the system barely write any.  So, who is more valuable to the team?  It's even harder when you are using a collaboration methodology like Extreme Programming, Scrum or Agile that really promote sharing and working together.  Jeff's post talks to this and other things so check it out.  If you don't subscribe to Jeff's blog I recommend it.  I don't always agree with Jeff's thinking, but at least he puts himself out there.  By doing that he get's me thinking...

Posted in Labels: | 0 comments

Are ADO.NET Datasets dead?

If you are plugged in at all to the Microsoft world you have been seeing more and more LINQ and ADO.NET Entity Framework buzz.  You can't go to a conference or attend a User Group meeting without discussing one of these new data access technologies.  I'm not saying that's a bad thing... Unless you are a Dataset, Datatable or Dataview.

I wrote a post back in May trying to shed some light on when to use which technology.  You might want to read that post and the comments before reading on.  In that post I stated that if you are creating new applications or just adding on features to your current app I would use LINQ or EF instead of ADO Datasets.  There are many reasons.  Here are the most compelling reasons to use LINQ and EF.

  • Objects - The nicest thing about LINQ and EF is they provide some of the foundations for Object Oriented programming.  They literally force you to think and work in terms of objects and collections of objects instead of rows and tables of rows.  By setting up this foundation, these technology allow for the application to grow and use some of the more complex OO concepts without doing tons of work to fill and save objects from Datasets.  So, start simple and as the requirements on your application change you can use some more complex OO topics to solve those problems.
  • Memory - There are two schools of though on this topic.  Some people like to pull all the data back into memory and then work with it there.  Others don't like to fill memory with data that might not ever be used.  LINQ and EF allow for both.  When you build your LINQ and EF models you can use stored procedures same as you used to with Datasets and bring back the whole table if you desire.  Or you can use the LINQ syntax to do filtering and sorting, which uses the power of the relational database engine to get only the row(s) you need.  To me it is compelling to have the flexibility that LINQ and EF give me.
  • Performance - We can go round and round about the performance implications here.  People say stored procedures are faster because they are pre-compiled, but with the new technologies these LINQ queries are cached and optimized and the difference is often minimal.  To me this is the 80\20 rule.  80 percent of my queries will run the same or faster in LINQ and EF than they do in a SP.  The other 20 percent of my queries will run faster in stored procedures.  So, use both.  LINQ and EF allow for using SP or the LINQ syntax.  Plus, with LINQ you can bring back only the columns you need which can improve performance as well.  I'm not saying quit using stored procedures, but instead of just blindly using them because that's what you've always done, step back and analyze your requirements to see if it's worth it. 
  • Interop with Other Object Collections - The other benefit of working with LINQ and EF is that you can join your data objects with other object collections.  If you've seen my talk on LINQ and the demo related to joining my SQL data with file data retrieved using the System.IO objects.  It is so easy and would require lots of work with Datasets.

There are many more reasons out there, but these are a few of the ones that are most important to me.  Any one else want to add?

The Most Popular Computer Languages

This is a shout out to all my VB readers out there.  First check out this article on the most popular languages.  At first I was surprised to find that C# is number 8 and VB is number 4.  However, it looks like they are grouping all versions of VB into the same category.  This makes more sense since VB has been around for way longer than C#. 

I love sitting around with some of the old timers talking about when they used to use punch cards to program.  To me VB is that legacy.  One day I'll be sitting around with some young whipper snapper right out of college saying:

"I remember back when I used VB 3 and I had to choose the option of creating a 16 bit or 32 bit application when creating a new project."

Today, VB.NET is a powerful Object Oriented language and is used in some of the most advanced software packages out there.  I just remember the days when it wasn't....

LONG LIVE Visual Basic!

Posted in | 1 comments

Useful Design Patterns

I'd like to thank the Northern Colorado .NET User Group for giving me the opportunity to speak to their group last night.  We had a good discussion about Design Patterns.  The patterns we discussed were Singleton, Command, State, Strategy, Provider, Plug-In and Module.  Although my demos are pretty simple and cut some corners, I think you can get a good idea of how to use these in your applications.  The take away from the discussion was that these patterns are great and provide some great guidelines, but they may need to be modified slightly to fit the problem you are trying to solve.  The 2 keys are to always code to an interface or base class and try to use aggregation in place of long complicate inheritance trees.  Again it was a great talk and I hope everyone in the group learned something.  I know I did.

Below is a zip that contains the slides, which explain these patterns, and all the demos.  There is also a DB script for SQL Server to create my sample DB.  The only change you need to make is the connection string for the DB.  Enjoy!

UsefulDesignPatterns.zip

Posted in | 0 comments

Returning XML from an ASPX page

Today I needed to make an ASPX page return a simple XML document with some basic server information.  The example below is over simplified but I think you can get the point.  This is pretty easy as it turns out.  Here are the steps:

  1. Create a new ASPX page in your solution just like you would any other page.
  2. Next remove everything from the markup except the @Page tag.  It should look like this an have nothing more:

 

  1. Here is a code snippet of the page load event that returns a simple XML element:

That's it.  I also found a nice post here that shows how to read XML from file and stream it back through the browser.  Pretty simple and useful.

Posted in | 3 comments

South Colorado .NET User Group Meeting is Postponed

FYI the South Colorado .NET User group meeting has been postponed due to some unforeseen scheduling conflicts.  The meeting will be next Tuesday July 8th.  Regional Director David Yack will be presenting on the new Dynamic Data functionality from the ASP.NET team.  It's a great topic from an exceptional speaker so don't miss it.  For more information please visit the South Colorado .NET Users Group web site.

Posted in | 2 comments

I never knew Software Architecture was a Democracy

I always thought it was a dictatorship run by Microsoft.  I came across this article about "A vote of no confidence" in the ADO.Net Entity Framework this morning.  I recommend spending some time reading the article and also following all the links to other related articles.  The issues are great concepts to understand. 

I'm not going to get into the specifics or defend one side or the other.  However, I want to express my position that there are 100 ways to skin a cat, or in this case architect a software application.  So, if you don't like the EF V1 don't use it.  If the issues being discussed are important to you and effect your application then by all means use whatever ORM or data access technology you like.

I joked about software architecture being a dictatorship, but the bottom line is will the end user care if you used EF, NHibernate or straight ADO.Net Datasets?  Probably not as long as the system works.  So in the end it is a dictatorship.  You (or your team) and only you decide what architecture to use.  However, keep in mind you are also the one that has to make it work and scale.

Signs that I'm doing ok as a (Geek) parent

My friend and co-worker Julie Yack posted about this subject on her blog here.  Her signs are probably more normal.  It made me think that my signs are geared towards the Geek (mainly Star Wars) culture.  Here are some signs that I'm doing OK as a (Geek) parent.

  1. My 5 and 3 year old children can hum both the theme song for Star Wars as well as the theme song for the Empire.
  2. When I say to my 3 yr old son "I am your Father" he responds with "No!" ala Luke in Empire Strikes Back.
  3. My 5 yr old daughter's favorite shirt is her green Yoda shirt.
  4. The kids favorite CD to listen to in the car is the soundtrack to Phantom Menace
  5. My son's room is decorated in Transformers decals.
  6. My kids both need a PC so they can go to their ".coms"
  7. And finally this says it all:
  • IAmYourFather
  • SpeederBike
  • Empire

Posted in Labels: | 0 comments

Too many moving parts!

I love design patterns.  Especially the extensibility patterns like provider and plug in.  Microsoft uses these patterns all over the place in the .Net Framework.  In fact, they are in the config files for every application we write.  That being said I think things might be getting a bit too extensible.  It seems these days I'm spending more time tweaking config files than actually coding.

For example, I've converted a handful of ASP.NET applications to the 3.5 Framework lately.  The change inside of Visual Studio 2008 on my development machine is pretty simple.  Visual Studio takes care of updating the web.config file for me.  However, I don't deploy my web.config files from my dev machine to the test and production servers because the config files contain environment specific settings.  So, I have to manually update the web.config files on these servers.  This is a major pain and takes a lot of trial and error to get it right.  Time I'd rather spend pulling out my finger nails.

Another example is what it takes to get a WCF service working.  Matt Brown did a presentation at the South Colorado .NET User Group on WCF earlier this month.  He did some great demos, but about half his time was spent tweaking the config files of his applications.  I think Matt has the most experience with WCF of any one I know.  Even he had to look a few things up and ran into some config issues.  This is not a knock on him by any means.  It's just another example of how reliant we are on config files these days.

I'm not saying I'm going to quit using these patterns.  In most cases I have no choice because it's just part of the Framework.  I will, however, take extra time in the design phase of my projects to determine where extensibility fits and where a re-compile and deploy might be a better simpler option. 

Posted in Labels: , | 2 comments

Data Access Technologies - Should I use ADO, LINQ, nHibernate or the Entity Framework?

I came across this blog post today that explains the differences between these data access technologies.  However, it does not give a definitive answer on when to use which technology.  That's because it depends on so many factors.  My advice is to keep it simple. 

Let me expand on the different technologies and provide some guidelines on when to use them:

Classic ADO.Net - In my opinion ADO.Net is a dying breed.  As a developer you need to know it for maintenance purposes, but any new features or products should be designed using LINQ or EF\nHibernate.  Some people might not agree with me here, but again this is my opinion.  The only caveat is to make sure the target environment supports the 3.5 Framework.  If the systems people will not let you install 3.5 on the server or end user's machine then LINQ and EF will not work. 

LINQ (LINQ to SQL) - As the blog post on this states, LINQ currently only supports SQL Server.  There are tons of open source projects that do LINQ to other things, but the only MS supported database backend is SQL Server.  For many of us, that is just fine.  If you know you need to support other DB platforms you can move on to EF\nHibernate now.  If you're pretty certain the only DB backend is going to be SQL Server then the decision between LINQ to SQL or EF\NHibernate comes down to architecture.  EF\nHibernate are full blown ORM tools, meaning they include many additional features (Inheritance, complex types, multiple data sources, etc) over and beyond what LINQ to SQL provides.  So, if you are using SQL Server and the application design is not overly advanced or complex.  I'd use LINQ to SQL.

EF\nHibernate - I lumped these two tools together because they are both ORM tools.  They provide support for many advanced and complex concepts in software design.  Using these advanced features is great if you are building a large enterprise, public facing or consumer use application.  However, for many applications these tools can be overkill and end up taking too much time to design.  That being said there is one thing that often gets overlooked, the fact that you can use these tools to do one to one mapping similar to the way LINQ to SQL does.  So, if you need to support mulitple DB backends, but you don't want to use the advanced features you can do so.

In summary, if you are building a simple application that is going to use SQL Server as the DB backend, use LINQ to SQL.  If you are building a simple application that needs to support a DB backend other than SQL Server, use EF or nHibernate and do one to one mapping between your entities and your DB tables.  If you are building a large application that requires some complex architecture, use EF or nHibernate.  Don't use ADO.Net for any new projects unless the target environment does not support the .Net 3.5 Framework.  However, I don't think it is necessary to go back and rip out all your ADO.Net code and replace it with something else.  Just be patient and use the new stuff with new projects.

Visual Studio 2008 SP1 Beta 1 Released

I know... I know... Many of you haven't installed the RTM version of VS 2008 yet.  These things are really starting to come out fast.  I guess Microsoft is finally realizing that most people don't install their products until after SP1 is released. 

This is still a beta, but it looks like it has some previews of some cool stuff.  It also looks like the install can mess up some of the other Beta\Alpha\RCs you have installed on top of VS 2008 currently.  So, check out these posts from the Scotts and actually read the release notes on this one before you install.

Scott Guthrie's Post

Scott Hanselman's Post

Posted in | 1 comments

Cloud Computing. Your Thoughts?

I just ran across this article out on Yahoo related to cloud computing and IBM and Google's plans for it.

http://news.yahoo.com/s/cmp/20080502/tc_cmp/207404265

Obviously I'm a huge Microsoft supporter.  I use Yahoo don't I.  If you don't use Yahoo, try it for awhile.  I recently decided to switch a couple weeks ago and I actually like it better than Google now.

Anyway, the article mentions they are planning to sell the use of Google Apps and Lotus Notes on this "cloud" network.  I'm just curious if anyone is using Google Apps or Lotus Notes currently?  If not would you switch from Office and Outlook if these apps where offered at a lower price through the cloud network?

Please submit you answers via comments.  I'd like to know what people think.

Posted in | 5 comments

LINQ Demo from Heroes Community Launch

Sorry for the lack of post lately.  My family just finished moving into a new house and my life has been a whirlwind.  Hopefully, we are on the downside and I can start focusing on Technology related stuff again.  Honestly, hanging curtain rods is not my idea of a great weekend...

Anyway, I wanted to drop the demo code, DB script and slides out here so people can take a look.  I had a great time doing the presentation with Eric Johnson.  Even though Eric is a DBA he is still a good guy.  Who knew that some DBAs actually have a soul?  Seriously though, I've been hanging out with the Springs SQL Server User Group for awhile now and they are a great resource when I come across SQL related issues.  Check them out if you haven't already.

Here is the Zip of all the materials from my session:

LINQHeroesLaunch.Zip

Posted in Labels: , | 0 comments

TFS Error - Command "exited with code 1" during build

We recently made some modification to our Team Foundation build server.  Ever since then my automated builds started getting this random error.

error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" workfold /map /workspace:"CTCTFSBUILD1_23" /server:http://servername:8080/ "$/myproject/Current2008/LumenWorks.Framework.IO" "c:\builddir\myproject\IB - Workflow\BuildType\..\Sources\myproject\Current2008\LumenWorks.Framework.IO"" exited with code 1.

It was a weird error because usually if I just started the build again it would complete successfully the next time.  It finally got annoying enough that I did some research and solved the problem.  It was a timeout issue.  So, if there was a heavy load on the build server my build would fail.  Here is the command that was causing the issue.

<Exec WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

Turns out there is "Timeout" property you can set.  I think the default is 30 seconds, but I upped it to 2 minutes just to make sure I didn't timeout due to server load.  Here is the command after I fixed it.

<Exec Timeout="120000" WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

I'm not sure how many people are running into this issue, but it was hard to track down so I posted it here and hopefully it will save some other people some time.

Posted in | 8 comments

CS Techcasts - SQL Server and LINQ Webcast\Podcast

Last Thursday at PASS Camp in Denver I participated in a live webcast\podcast related to SQL Server topics.  Why was a developer involved?  Well I don't want to spoil the surprise so you'll just have to watch.  Wether your a SQL Server expert or just know enough to be dangerous this is a great informational cast.  Check it out!

http://www.cstechcast.com/home.aspx?Episode=15

LINQ to SQL is the Devil?

Last Thursday I attend the SQL Server Pass Camp in Denver.  As one of the only developers there I got a lot of negative vibes related to LINQ to SQL and ADO .Net Entity Framework.  DBAs seem to think any tool that generates SQL statements is evil.  I have to admit I agree with them.  Even if the generated SQL is flawless, it can take away the DBAs ability to tune performance.

However, I think there is a happy medium that will help DBAs sleep at night and still give the developers the flexibility they need.  It's the same answer we've been using for years, Stored Procedures.  If you think about it, developers have had the option of running SQL queries directly against the DB for years using inline SQL statements.  So, nothing has really changed.  LINQ to SQL and the Entity Framework both have full support for stored procedures.  Use Stored Procedures for all updates, inserts and deletes.  You can also use stored procedures to retrieve data. However this takes away some of the the flexibility LINQ to SQL and the Entity Framework provide to the developer.  So, for reads I recommend using views.  They allow DBAs to restrict the columns visible and also provide an extra layer of security.

All the feed back I received from DBAs was positive once I explained that stored procedures and views are still the best practices for these new technologies.  They were also put to ease when I reminded them that this really is nothing new for them.

So to answer the question, LINQ to SQL is not evil.

Fallout From The Colorado PASS Camp

Yesterday I attended and presented at the Colorado SQL Server PASS camp.  A developer at a SQL DBA event?  And he made it out alive?  Yep I feel like I cheated death.

No seriously, I had a great time and learned many things about some of the DBA's fear of LINQ and the ADO.Net Entity Framework.  I will post more about this subject in a separate post in the interest of not making my posts too long.

Look for a series of posts regarding the info I gathered from attending this event.  Thanks to everyone who organized and attended the event!

Posted in Labels: , | 0 comments

SQL Server - Colorado Pass Camp this Wednesday and Thursday

I apologize for the late notice on this but tomorrow and Thursday is the Colorado Pass Camp in Denver.  It is a free event related mostly to SQL Server related topics.  You can get all the info and register here.

I’m mostly a developer, but I find it makes me a better developer if I understand SQL Server and the issues most DBAs deal with on a daily basis. 

In this age of technology no one can know everything about everything.  However, understanding the theory and reasoning behind many different things can help you do a better job of developing good applications.  I might not always know the details of how to do certain things in technology, but I can always learn and find the details online when needed.  So, simply knowing the strong point for using one technology over another is enough to make a decision and then go learn the details after the decision is made.

I am actually a part of PASS on Thursday.  I’m participating in a pod\screen cast in the morning and then presenting on LINQ and .Net in the CLR later in the day.

Please come up to me and say Hi if you are attending!  See you there.

Posted in | 0 comments

To Invoke or not to Invoke? That is the Question!

Yesterday I was having a problem with my UI on my smart client application.  I’m using the offline data block from the MS Patterns and Practices group.  It took awhile to learn how to use this, but now that I am I really like it.  It uses a separate thread to do the data requests.  Well, as most applications would I wanted that thread to update a progress bar on my UI to tell the user how many requests where in the queue and when they where completed.

This sounds like it should be easy, but hopefully most of you know that a separate thread cannot update a UI element on the main GUI thread.  This article talks about why and how to do it using the Invoke() method.  I was using the Invoke() method and everything was running fine at first.  However, after I started testing the application started to deadlock\freeze.  I put lock statements all around my code to try and avoid the problem to no avail.

Finally I ran across this post from Kristof Verbiest which explained my problem.  The Invoke() method IS NOT an asynchronous call.  The code will wait for the method called within the Invoke() to complete before it moves on.  So, what was happening was my main thread was waiting for the Invoke() and also calling the thread to do another request.  This caused the deadlock.  The post from Kristof explained that the BeginInvoke() method IS an asynchronous and will allow the code to continue.  By changing my Invoke() calls to BeginInvoke() I fixed my problem.  Thanks Kristof!

So the answer is to not Invoke(), but to BeginInvoke()…

Posted in | 2 comments

Application UI Design Mistakes

I came across this article in my daily web surfing.  I’d like to think I know all these rules, but they are good to keep in the back of your head and revisit when you start desigining UI for a new project.

Posted in | 0 comments

South Colorado Launch 2008

It’s official!  Friday, April 4th from 2:00 – 6:00 PM all three South Colorado User Groups (.Net, SQL Server and Windows Server) will be collaborating to bring you some great content related to the new releases of Microsoft technologies.  All the sessions are still being finalized and the official schedule should be up soon.  Keep your eye on the official site here for more details.

I’m sure there will be great content, but please plan on attending for no other reason than to connect with the Microsoft community here in the South Colorado area.  Learning from our peers is a fun way to think outside the box and come up with new ideas to solve everyday issues.  I hope to see you there.

If the weather cooperates you should just take the whole day off and get in 18 holes before attending.

Posted in | 0 comments

WCF 404 Page Not Found

Just a quick note about hosting your WCF service in IIS.  I had some problems getting this to work yesterday.  Everything worked great on my developement machine.  I had my WCF service serving up data and functionality to my ASP.Net front end and a Windows Service I’m using for automation and monitoring.  I moved everything out to IIS on the test machine, configured the sites in IIS and started testing.  I kept getting HTTP 404 Page Not Found Errors while trying to reach my WCF service.  I found a great blog post from Jean-Paul Smit that finally solved my issue.  I had to do number 3 in his list of possible solutions. 

%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /s:W3SVC

Once I ran this from the cmd prompt everything worked great.  Thanks Jean-Paul!

One final note: If you don’t have the file mentioned above you need to download and install .Net Framework 3.0.  I ran accross this on one of my servers. 

Posted in | 12 comments

Serializing a Generic Dictionary

So, I created all this fantastic code (God, I love my work) that used a singleton to hold some data that I needed throughout my app.  One of the properties in that class was a generic dictionary.  Well, as I got further into the application I came across the need to persist this data to an XML file.  Naturally (almost instinctively, which means I have no life), I wrote the few lines of code to use the XMLSerlializer to save this to disk.  The problem is the generic dictionary is not serializable.  I was dreading the idea of changing the way I was storing and using that dictionary all through out my app.

To make a long story short, (too late) I did a search and found this post from Paul Welter’s blog.  All I needed to do was create this class in my project, change the data type on my dictionary in my Singleton and it all worked and serialized perfectly.  Thanks Paul!

Posted in | 0 comments

Salesforce.com Announces Development-as-a-Service

Many of the ‘line of business’ applications today are starting to expose their core framework as a development platform.  MS CRM is a great example of this.  It’s a great CRM solution, but it can also be extended and used to solve countless other line of business needs.  For more information on MS CRM check out David Yack’s CRM blog or the MS CRM site.

Salesforce.com is jumping on this bandwagon but is also adding an interesting twist.  They are selling their development framework as a service.  It’s also interesting that they are introducing a $0.99 per login option.  You can find some details about this announcement here and get more information on the Salesforce site.  MS CRM has a similar option called MS CRM Live that includes a subset of the extensibility features and is hosted by Microsoft.  You can read more about MS CRM deployment options here.

Looks like these two products are going to battle it out in this space.

Posted in | 0 comments

LINQ Visualizer

Scott Guthrie does a great job of describing how to get and install this here.  Take the 5 minutes to do it.  It’s worth it.

Posted in | 3 comments

LINQ Talk - Colorado Springs SQL Server User Group

I just got the opportunity to do a talk on LINQ at the Colorado Springs SQL Server User Group tomorrow night January 16th.  The meeting starts at 5:30.  I’m going to add some content that is more SQL Server related and try to inform everyone what LINQ means to the SQL DBA community.

For more info please vist the Colorado Springs SQL Server User Group site.

Hope to see you there.

Posted in | 0 comments

Accessing the ApplicationSettings section of the App.config with C#

OK, this sounds like a no brainer, but I ran into an issue the other day and it took me forever to find the information needed.  I used the GUI in VS 2008 to create some strongly typed application settings.  This is easy to do.  Right click on the project and select Properties.

AppSet1

I created two settings: one is a DateTime and the other is a bool.  This is the easy part.  The hard part is getting and saving these settings in code.  Well, it’s not hard once you know what you are looking for.  I searched far and wide using ‘Application Settings’ and C#.  I found all kinds of document ion about the Mysettings namespace in VB.Net but nothing on C#.  I even scoured the documentation from MSDN.  I finally found an answer on a forum somewhere.  You use the ‘Properties.Settings.Default’ namespace.  So, I can access my settings using this code.

AppSet2

If nothing else just remember this post for future reference in case you run across this yourself.  For some reason the ‘Properties’ namespace just isn’t intuitive to me.  There is also a lot of confusion out there revolving around the difference between ‘Properties.Settings.Default’ and the ‘System.Configuration.AppSettingsSection’ namespaces. One of the reason I’m blogging on it is so I can reference it the next time I run into this.

Posted in | 18 comments

Microsoft's Enterprise Library

I recently received a questions regarding the best practices for doing data access.  My company has our own internal data access architecture and code generator that works great.  However, if you are starting a new project and don’t have an established architecture, I would take a serious look at Microsoft’s Enterprise Library as a starting point.  It contains many best practices regarding data access, logging, exception handling and more.  What’s better is you get the source code so you can tweak it as needed.  

There is also some great and affordable training on Enterprise Library available from Innerworkings.  I’ve blogged about Innerworkings before (here).  They have mastered e-learning.  Just go to the catalog on their site and you can find the Enterprise Library training in either VB.Net or C#.  I think the two part series will run you about $60.  Not a bad way to get a quick start in this stuff.

Posted in | 3 comments

JavaScript Performance

I subscribe to the Jeff Atwood’s Coding Horror blog and he posted this yesterday about JavaScript performance.  He also mentions that the browser market is getting more and more competitive so if you have a public facing web application make sure it looks good on all the latest browsers.  Sometimes us ASP.Net coders forget there are other browsers out there  

 

Posted in | 0 comments

ASP.Net 3.5 Extensions and ASP.Net Dynamic Data Support

I also installed the ASP.Net 3.5 Extensions yesterday.  I figured I might as well take the plunge on all this stuff.  I’m hoping to install and play with the ADO.Net Sync Framework sometime soon as well.  Anyway, the CTP for ASP.Net Extensions is an easy install.

The best source for information on this is Scott Guthrie’s blog.  If you don’t subscribe to his blog you should.  He post great stuff for developers of all skill levels.  Below are a couple of cool posts he’s done lately related to the Extensions CTP.

What’s Included in the ASP.Net 3.5 Extensions CTP

ASP.Net Dynamic Data Support

Posted in | 0 comments

Installing the Latest Version of the ADO.NET Entity Framework

Last night at the Installfest in Denver we got a quick look at the ADO.Net Entity Framework.  It looked interesting to me so I researched it a bit more today.  The overview here is a pretty good place to start.  I’d read through that first to get an idea of what we are trying to accomplish.  Then make sure you have Visual Studio 2008 installed and follow these steps to install the add-ons that allow you to start playing with the Entity Framework:

  1. Make sure you uninstall any previous versions of the ADO.Net Entity Framework.
  2. Install this hot fix for Visual studio 2008.  Honestly, I could not find much documentation on why this is needed.  For what it’s worth, I installed it and it didn’t break anything that I can see.
  3. Install the ADO.Net Entity Framework Beta 3.
  4. Install the ADO.Net Entity Framework Tools.
  5. Install the ADO.Net Entity Framework Samples.
  6. Check out this additional documentation.

If you were using the old version of the framework you might want ot check out this post about the breaking changes between Beta 2 and 3.

Other than that happy coding!  Please let me know how it goes and any cool things you find with this stuff.

Posted in | 0 comments

Visual Studio 2008 Installfest

Last night we had a great event in Denver.  It was called an ‘Installfest’ and included a free version of VS 2008, free drinks, great food, networking and great demos of the new features in VS 2008.

If you’d like to take a look at some of the stuff we discussed here is a link to Rob Bagby’s post with the info.

We also talked about many things that are not in these demos.  We spent some serious time on LINQ.  If you want to learn more about link you can get started by downloading my presentation and demos here.  Scott Guthrie’s blog also has a whole series on LINQ.

Finally, we touched on a couple of new things that look really cool.  The Entity Framework and the Sync Framework.  I did a bit more research on these two topics today.  I also installed all the extensions and add-ons to get these things working.  I will put the installation steps in a different post shortly so those folks looking just for the steps can find them.

Overall, it was a great event and I recommend going to an Installfest in your area.

Posted in | 0 comments

Software Developers Lifecycle

I’m a fan of Jeff Atwoods Coding Horror blog.  He does not just blog about technology, he also includes good information about the best practices and overall philosophies of being a software developer.  A great example is this post about the two types of programmers in the world.  If you didn’t read it please take a few minutes to read through it before continuing on.

I’d like to think that I’m in that top 20%, but in reality I’m probably in the top 20% of the 80% group Jeff describes.  I love coding, but I also enjoy many other things like spending time with family and friends.  Being the father of two children under the age of 5 (and another expected soon) when I get home it’s time to be a dad not a coder.  I also enjoy watching sports (This is my reality TV), playing sport, playing video games and generally getting out and enjoying life.  So, I rarely code on the weekend for fun.  I do it every now and then just to keep up with the latest and greatest .Net releases but it’s few and far between.

Right now your probably thinking who cares?  The reason I mention all this is that I believe just like the phases of the software development lifecycle, we as software developers also go through a ‘lifecycle’.  When I was fresh out of college I was all about the latest and greatest technology and spend much of my free time coding and researching.  I even took a weekend crash course in .Net 1.0 beta that took up my every weekend for 2 months.  It was fun.  At this point I was in the top 20%. 

However, once I got a family my free time diminished and I took a corporate job that allowed me to put in my 40 hrs a week and go home to my family.  At this point I fell into the 80% range.  Not that there is anything wrong with that. That is where I was at in the Software Developer Lifecycle.

Now, my kids are getting a bit a older and I’ve gotten back into the realm of consulting which gives me more flexible hours to ‘play’ with technology.  I’m trying to get back into the top 20%.

The moral of this post is depending on your life priorities you might have to change your perspective on the kind of developer you are.  Just like in the Software Development Lifecycle, you might have to drop into maintenance mode for awhile.  Then once your priorities change, you can add new features to your career or start back over at requirement gathering…

Posted in | 0 comments

Float DBParam to a Money column

I ran into a very interesting issue today.  I was passing in 0.0100 as a parameter to an SP.  When I ran it through debug it did not bring back any records.  However, when I called the exact same SP with the exact same params from SQL Server management Studio it worked fine.  I fixed it by adding a specific cast to my SP in SQL.  The Example is below:

where ShippingCostApplied = Cast(@ShipRateByCube as Money)

I think it might have something to do with the type conversion from .Net into SQL.  There is not a money data type in C# that I know of.  So, I was storing the data in code as a float.  Not sure why the float was not getting converted right, but keep this in mind when messing with the money data type.

Posted in | 3 comments

LINQ Slides and Demos

I’d like to thank everyone who attended my LINQ talk at the South Colorado .Net Users Group on Tuesday.  I thought it was a good discussion.  I’m still finding my way around LINQ myself and your questions and comments will help me become a LINQ master..

Below are the zip files from the meeting.  One is the presentation in both Office 2003 and 2007 format.  The other is all the demos.  You will need Visual Studio 2008 Beta 2.  You will also need to download and install the Entity Framework.  Enjoy!

I will do some research to answer some of the questions we could not answer and post my results.

File Attachment: LINQ Presentation.zip (1685 KB)

File Attachment: LINQ Demos.zip (1745 KB)

Posted in | 0 comments

Visual Studio 2008 Releases by the End Of The Month

Tim Heuer the .Net Evangelist out of Phoenix just spilled the news.  Read about it here.  I’m excited to start using it.  I’ve been using the betas off and on for about 2 months now and I really like it.

I’m also doing all my LINQ demos with the Beta 2 version tomorrow night at the South Colorado .Net User Group.  Stop by if you want a preview of LINQ or a quick look at Visual Studio 2008 in action. 

Posted in | 0 comments

LINQ talk at the South Colorado .Net User Group on Tuesday

Sorry for the recent draught of post out here, but I’ve busy preparing a talk I’m giving on Tuesday Nov. 6th at the South Colorado .Net User Group.  The group meets in Colorado Springs.  My talk is on LINQ (Language Integrated Query).  I’ve been doing research and creating samples and demos so I’ve had no time to post.  However, once I complete the talk I should have some time to blog about my LINQ discoveries as well as some CRM stuff I’m been hearing about.  Until then, I hope to see you all at the user group meeting.

Posted in | 2 comments

More On The ASP.NET MVC Framework

Here is Scott Hanselman’s take on it.

Posted in | 0 comments

ASP.NET MVC Framework

Having a small passion for Design Patterns I’ve been playing with the model-view-controller (MVC) pattern for awhile now.  Microsoft is working on a MVC framework for ASP.Net.  See Scott Guthrie’s post on it here.  This looks like a really cool thing and I can’t wait to play with it. 

Sometimes I see MVC being very useful for creating an application framework.  However, other times I see it being very cumbersome for making simple changes.  So, the one caveat I have to the ASP.Net MVC framework is to do some design first and see if it is necessary for your application.  For large enterprise applications this will be great.  For smaller web applications this may be overkill.

Posted in | 0 comments

DefaultButton Attribute in ASP.Net

I just found a cool attribute that you can use on many of the ASP.Net 2.0 and above controls.  Its the DefaultButton attribute.  You can use this on the Form tag to make one default button for the entire page or you can use it in the ASP Panel to make one default button for just that area of the page. 

It’s quit simple to use.  I had two different areas where users can enter values in a text box.  I found myself typing in values and hitting Enter to submit.  Well, the Enter key would cause a refresh of the page, but my handlers were not firing.  I added a panel around these two areas, set the DefaultButton attribute and bam, it works great now!

Posted in | 0 comments

Open Source vs. Proprietary

Here is a link to an article I found on the benefits and draw backs of these two software development philosophies.  There were only 228 companies surveyed, but the results are interesting. 

My take on this topic is that open source is anything but free once you take into consideration the cost of initial installation and maintenance.  However, with all the toolkits, extensions, SDKs, etc. that have to be installed these days to develop with proprietary systems, the gap is closing.

After developing so long on the proprietary side of things I find it hard to make the switch to open source.  So, many of the things I take for granted in the proprietary world just aren’t there in open source.

Posted in | 0 comments

Tools For Web Developers

I haven’t needed to use Fiddler for awhile and I noticed there is a 2.x version available here.  For those of you that have never used Fiddler it is very useful to debug Web Apps.  It allows you to view what is being passed between the server and the client.  Even the Ajax callbacks.  If you have not used it try and let me know what you think.

There are some additional links on the Fiddler install page that are useful for web development as well.  I use the IE Developer Toolbar often to debug CSS\style issues.  I have not used any of the IE Powertoys for WebDevs.  I’m installing it now.  I’ll let you know what I think.  Again let me know what you think of these tools.

Posted in | 0 comments

Follow-up on My Locking Issues

I finally was able to fix the issue in my previous post.  The problem was not the locking hint on the queries, but the fact that the column I was using in my where clause was not indexed.  So, even though only the row was being locked the next update needed to do a complete table scan to find the next row to update.  This table scan was blocked until the previous update finished.  Since these updates were all happening in the same transaction, deadlock occurred.  Once I indexed that column the issue went away.

Posted in | 0 comments

Being on the Bleeding Edge...

Just a quick post about being on the bleeding edge.  I’ve recently been working with Windows Workflow using the Service Broker to queue up my workflow requests asynchronously.  This is a great concept, but I’ve been amazed at the lack of quality information on these two pieces of technology.  Sure there is plenty of information about the theories of these technologies and how to get started.  However, there is a huge void of information about how to debug and fix things when they break.

This is one of the problems with working with new technologies right out of the gates.  Sure there will always be a learning curve when using technology that you are not familiar with.  However, the magnitude of that curve is far greater when the technology itself is in it’s infancy.  It takes much longer to get past an issue when you have to dig and use trial an error as opposed to searching the web and finding documentation, articles and\or blog posts on it.

This is the bane of my existence these days and I think there are many developers out there that would agree.  As soon as I get over the learning curve for a piece of technology the new version of, or a replacement for, that technology is released and I have to go through it all over again.  So, in essence I’m in a learning curve that never hits the down ward side of the curve!!!

In order to fulfill the demands of our clients we need to use the latest and greatest technologies (I’m getting pretty comfortable with all the Ajax stuff, now everyone wants to use Silverlight).  Don’t get me wrong, I really like learning and using new technologies.  Plus I take pride in being one of the first implementors of these new technologies.  However, it would be nice to sit back and write ‘Hello World’ apps every once and awhile…

Posted in | 0 comments

SQL Locking

Recently my database has been experiencing some deadlock issues.  The issues are due to some automation we’ve created to update inventory levels.  This automation is close to real time.  Meaning the inventory table is constantly getting updates and inserts.  This caused all kinds of locks and blocking.  To start with check out this MSDN article on Locking Hints.

In my case, I started by using row locks when doing my updates.  Here is a sample of my changed SQL:

Update Inventory WITH (ROWLOCK) set CountOnHand = @CountCurrentOnHand, Price = @Price, InventoryDesc = @InventoryDesc where InvID = @InvID

That reduced the deadlocks, but did not solve them.  So, I also added the NOLOCK to the queries that access the inventory table on a regular basis.  Here is a sample of the SQL:

Select * from Inventory with (NoLock)

This can be risky because doing so is a ‘Dirty Read’.  This means I could read data that has not been committed and might possibly be rolled back. In my case the inventory levels are important, but they are also verified and corrected on checkout.  So, for the time being we are running in this manner and keeping an eye on things.  Any comments are welcomed.    

Posted in | 0 comments

A couple cool free apps I've been using

I have not had a chance to blog about a couple apps I found online.

The first one is called Quest Comparison Suite for SQL Server.  This is an alternative to using Red Gate SQL Compare.  I have used Reb Gate in the past and it is great, but it is pretty pricey.  This tool is pretty impressive for a free tool.  It was written using the .Net 1.1 framework but still works well.  The only issue I’ve had with it is the way it creates the SQL scripts.  Sometimes it inserts transaction and rollbacks that cause some issues.  I turned those off and use this to create a SQL script that I then go in and modify a bit to get the job done.  Overall it is a great tool and it’s free!

The second is one I just downloaded and installed this week.  It’s called Synergy.  This is a great tool that let’s you share a mouse and keyboard between machines.  I know this doesn’t sound like anything to blog about, but let me explain how it works.  Most people know about KVM switches.  Well with this tool you can do the same thing that a KVM switch can do without the switch.  It uses the network instead.  So, as long as the two machines are on the same network you can setup Synergy to switch machines when your mouse hovers over any edge of your screen.  You configure which side of the screen goes where. 

I use Synergy because I have a laptop that I use to develop from home and a desktop that I use at work.  So, when I’m at work I can set this up so I can use the same keyboard and mouse and switch between my desktop and laptop.  It works like I have dual monitors setup but it actually switches from my desktop screen to my laptop screen and back.  It’s hard to explain, but it is cool. The only downside is the UI for this tool.  Setting it up is a pain through the UI, but once it is setup it is great.  If you want to try it be sure to read the documentation.  We all read the documentation before we use stuff right  

Posted in | 1 comments

Comments On Last Nights Design Patterns Talk

Last night I presented on simple design pattern at the Denver .Net User’s Group.  Here are a final comment:

During the presentation I received a very valid questions.  ‘Why use a pattern when I can just code the new functionality right into my concrete object?’  The answer I gave last night was you CAN code the functionality right into the base object.  That would work just as well as using a pattern to do it.  I stick by that answer.  If there was a cookie cutter solution for every software issue out there, we would all be out of a job.  From all the announcements on job posting before the meeting we can all see this is not the case.  What I’m trying to say here is that design patterns are not meant to be the end all be all of OO design.  So, don’t try to ‘fit’ your solution or design into one of these patterns.  Instead, focus on the underlying philosophies of these patterns to solve the problem.  The most common philosophy in patterns is coding to an interface.  Use interfaces and base classes as much as possible to provide flexibility and ease of maintenance.  So, when your out there researching and learning design patterns, try to think outside the box and by all means modify the pattern to solve your issue.

I got some great feed back from Brad Wood (Thanks Brad!).  He sent me a great link to Jeff Atwood’s blog post on the Gang of Four book and how it is misused in some cases.  It relates to what I said above.  I will let you read it and try not to skew your opinions of it.

The title on my blog is Keep it Simple Stupid.  I try to use that every day when I design and code.  Some design patterns are overkill for many issues.  So, the challenge we all have is to learn these patterns back to front so we know when a pattern is the right solution and when it is overkill.

Also, I forgot to mention this when I posted the samples and demos but if any of you have your own blogs feel free to post and link to my blog if you deem it worth.  That is all I’m going to say on it.

Posted in | 3 comments

Slides and Samples From My Presentation At The Denver .Net User Group 07/23/2007

This zip file contains everything from my presentation last night.  If you were not able to make it please check out the Power Point because I made it a point to be pretty descriptive on my slides to allow people to review the patterns and make sense out of the demos.  If you have any questions feel free to email me at BenH@coloradotc.com or just comment on this blog.

A couple of things about the demos.

  1. If you have attended this talk in the past at another user group or code camp, you might want to get and look over this presentation again.  I re-did all the demos and made extensive changes to the slides.  So, take a look.
  2. You must run the script in the “DBScript” folder against you SQL server if you are going to use the SQL server provider.  This script will create the DB, the tables, the stored procedures and finally fill in all the sample data.
  3. After you run the DB script to create your DB you will also have to change the connection string in the SQLDAL.cs file to connect to your SQL server.
  4. I used Access 2007 in the demo, but I have also provided an Access 2003 version for those of you who do not have Access 2007 yet (Shame on you if you don’t… :-))
  5. Again, if you want to use the Access provider you will have to change the connection string in the MSAccessDAL.cs file to point to the proper file.
  6. I had a problem with my Add Vacation decorator demo.  I have not had a chance to fix that yet.  Once I do get it fixed I post the file again to this site.  Hopefully, I will do that in a couple days.

Other than that happy coding.  Please add my blog to your aggregator.  I have already received some good feedback from last night’s talk and I have a few comments of my own that I will be adding out here shortly.

File Attachment: DesignPatterns.zip (1223 KB)

Posted in | 0 comments

Troubleshooting SQL Server 2005 Service Broker

My latest project has not only required me to use Workflow but also to create and use a Service Broker on SQL Server 2005.  Service Brokers are similar to MSMQs (Microsoft Simple Message Queues) except they are managed by SQL Server 2005.  For a great introduction to Service Brokers check out this intro on The Code Project.

Service Brokers are pretty simple to understand.  There are also many articles out there on how to set one up.  Most of this is pretty simple to setup as well.  However, there is not much out there on how to troubleshoot if something goes wrong.  In my case, I’m still not 100% sure what did go wrong..   However, I do know it is fixed now. 

The frustrating thing is that when I actual started the conversation and sent the message I got no errors.  All I knew was that the queue was still empty and my receiver never got the message. 

I stumbled across a great article on troubleshooting here.  This article helped me put together a series of queries that ultimately led me to determine the errors I was getting.  Here is the query I created:

-- This query get's incremented if your msgs are having errors

select p.*

from sys.objects as o

join sys.partitions as p on p.object_id = o.object_id

where o.name = 'sysxmitqueue'

 

-- Error messages in the queue are located in the transmission_status field

SELECT *

FROM sys.transmission_queue

 

SELECT conversation_handle, is_initiator, s.name as 'local service',

far_service, sc.name 'contract', state_desc

FROM sys.conversation_endpoints ce

LEFT JOIN sys.services s

ON ce.service_id = s.service_id

LEFT JOIN sys.service_contracts sc

ON ce.service_contract_id = sc.service_contract_id;

These queries give you all the system related info about the brokers.  Hopefully you can use this to troubleshoot your own Service Broker.  

Posted in | 3 comments

Been Learning Windows Workflow

Sorry for the lack of posts lately!  I’ve been working on a project involving Windows Workflow and it’s been consuming all my time.  I’ve also had a run of personal events that have been taking up any free time that I’ve had.  The nice weather of the spring season has also been calling me to get outdoors.  Anyways, I’m back and ready to blog all my experiences with Workflow.  So, be ready for many new posts in the next few days.

Posted in | 0 comments