Creative Jar Blog RSS Feed

LINQ : Why hardcode anything?

November 21, 2008 17:06 by tim

Man, this LINQ stuff is amazing

I was dubious at first, to be honest.  I'm confortable with SqlCommand and the logic required to build relational data with Foreign Keys and Cascade delete ; "Who needs another data access language??", I said

The more I use LINQ, the more I'm glad it's here.  I did some old school SqlCommand stuff yesterday afternoon, normalising a flat data structure into something a bit more updatable.  Sqlcomands for every different insert, multiple parameters and data types, cycling through DataSets and filling the data as I went.  The debug was a total nightmare with all the hardcoded parameter names and insert statements

The fruit really materialised when I re-did the data access for the site in question.  Strongly-types objects which would only accept normal data, automagically created List<> of related data, so easy to update and even transaction to boot. 

LINQ does enforce a strict data layout and naming convention, but its well worth it

/never looks back!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Calendar

March 2010
SuMoTuWeThFrSa
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910