Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting data into dtat table
Message
 
To
15/10/2007 09:56:56
Ian Hammond
Greenfield Software Ltd
St. Neots, United Kingdom
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01260301
Message ID:
01261177
Views:
19
Ian,

>The record I will be returning via the web service will be incomplete and will comprise a number of invoice header records.
>
>The web service will invoke the Invoices object and a method I will expose will be to save an invoice header record.
>
>1) The constructor of the invoices object calls the GetEmptyDataSet() and sets a dataset field. (or do I need to call this for each newrow?)
>
>2) The SaveInvoiceHeader(DataRow row) method: this creates a new row for the dataset created in the constructor: The fields in the argument are passed to the new row via the field namees or can you link the new row to the Entity, I'm not quite sure where this fits in.
>
>3) When all the invoice headers have been copied into the new dataset, how does this get passed into the physical database.

You can do the following:

  1. Instantiate the Invoice object...creating an empty data set in its constructor will work fine. You don't need to call it for each new row

  2. In the SaveInvoiceHeader method you can pass in the DataRow and have this method call NewRow(), copying the data from the row that passed to the method into the new row. If you have an older version of MM .NET you may not have entity support, so you can just use the DataRow.

  3. When all invoice headers have been copied, just call the object's SaveDataSet() method.


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
Previous
Reply
Map
View

Click here to load this message in the networking platform