Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic update data before saving new record
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01141529
Message ID:
01142021
Vues:
16
>For example, I have a business object called 'Order', which bind to order table. The
>order table has a field called 'orderDate'. When the user adds new order, my
>application will automatically set the orderDate to today's date. Then save the record
>into database using business object. I tried to update the orderDate value in business
>object entity. The code as below:
>
>
>order.Entity.orderDate = Now.Date
>
>
>But it causes runtime error. Below is the error message shown in web page.
>
>

>Object reference not set to an instance of an object.

I'm guessing that order.Entity doesn't have a DataRow at the point you are trying to set the date. Can you post the entire method where you are trying to set the date?

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform