CodeSmith Community
Your Code. Your Way. Faster!

Basic Data Question

Latest post 05-12-2008 8:36 AM by SuperJeffe. 1 replies.
  • 05-12-2008 4:39 AM

    Basic Data Question

    Hi all,

    Basic .NETTIERS question.

    If i need to exclude certain fields in an insert or update how do i go about doing this in nettiers.

    Do i have to write my own procedure and have it wrapped into the generated .nettiers api?

    An example of doing this may be, say CreatedDt would be populated on insert but not update.

    UpdatedDt would be modified during an update but not an insert. Do i have to supply dummy data for the unecessary fields for each action?

    This may not be the best example, but there are occaisions when not everything in an entity requires updating in the db at one single point in time.

    So how do i exclude this information in a respective command.

    Help appreciated.

    Cheers,

    Adam

    • Post Points: 35
  • 05-12-2008 8:36 AM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 332
    • Points 8,350

    Re: Basic Data Question

    Well, Nettiers sort of expects you to retreive the data from the DB first.  Then call update.  If you don't update those fields in the entity, it won't get updated in the DB.   

    If you have code written to always change those fields even though you don't want to update them, then yes, custom update procs will be required.  Problem there is you would need to override the update procs or call a custom save.  If you called Save on the Data layer, it would just call the normal Update, unless you override.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems