How to make writing Inser and Update functions easier?

How to make writing Inser and Update functions easier?

Old forum URL: forums.lhotka.net/forums/t/3030.aspx


josh.kodroff posted on Tuesday, June 12, 2007

Am I the only one who is finding writing (debugging) the Insert and Update functions a major PITA?  I keep messing up the sql parameters, and it occurred to me that this is manual labor we probably don’t need to be doing.

 Anyone got any ideas?  Use a VS snippet?  Does Enterprise Library fix this?  Make the classes Partial and use a code generator to write those two functions?   Even if we can't autodiscover the parameters, just having a grid to fill out and have the code generated from there would save oodles of time.

Brian Criswell replied on Tuesday, June 12, 2007

How about using NHibernate?  Maybe couple it with the data access object pattern?  NHibernate is demonstrated in an example project in CSLAcontrib, and I have made a post regarding the data access object pattern in the forums.

RockfordLhotka replied on Tuesday, June 12, 2007

The DAAB in EntLib does help. nHibernate can help, as can pretty much any ORM tool.

LINQ for SQL and ADO.NET EF will help when they come out, and I'll be moving ProjectTracker to use LINQ at some point in here.

Code generation can also help, as a lot of the code-gen templates create the DP_XYZ methods for you.

josh.kodroff replied on Monday, June 25, 2007

Brian,

Could you drop a quick link to that post?

Thanks.
JK

Brian Criswell replied on Monday, June 25, 2007

http://forums.lhotka.net/forums/post/15193.aspx

Copyright (c) Marimer LLC