Bill,
>I need to know how to save an entity object in the datarow in order to save the dataset.
>I have code like this:
>
>oQuoteBiz Quote = new QuoteBiz;
>oQuoteEntity = new QuoteEntity()
>// set some values in the entity
>oQuoteEntity.QuoteDate=DateTime.Today;
>...
>oQuoteBiz.NewRow();
>oQuoteBiz.Entity=oQuoteEntity;
>
>// now how do save the entity in the data row ?
>// is there a better way than coding each column ?:
>oQuoteBiz.DataRow[0]["QuoteDate"]=oQuoteEntity.QuoteDate;
>...
>
>oQuoteBiz.SaveDataRow();
Here's an example of how you can do this:
Orders oOrder = new Orders();
oOrder.GetEmptyDataSet();
oOrder.NewRow();
oOrder.Entity.CUSTOMERID = "QUICK";
oOrder.Entity.EMPLOYEEID = 5;
oOrder.Entity.ORDERDATE = DateTime.Today;
oOrder.Entity.REQUIREDDATE = DateTime.Today;
oOrder.Entity.SHIPPEDDATE = DateTime.Today;
oOrder.Entity.SHIPVIA = 3;
oOrder.Entity.FREIGHT = 12.34M;
oOrder.Entity.SHIPNAME = "QUICK-Stop";
oOrder.Entity.SHIPADDRESS = "Taucherstraße 10";
oOrder.Entity.SHIPCITY = "Cunewalde";
oOrder.Entity.SHIPREGION = "01307";
oOrder.Entity.SHIPCOUNTRY = "Germany";
oOrder.SaveDataSet();
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com