Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Entity Objects
Message
 
À
06/12/2006 11:48:22
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01175267
Message ID:
01175570
Vues:
7
>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();
>
>Thanks

In the current version of the framework, an entity's properties are tied directly to a datarow (so a DataRow must exist before you can use the entity).

Try something like this instead:
oQuoteBiz Quote = new QuoteBiz();
oQuoteBiz.NewRow();

oQuoteBiz.Entity.QuoteDate = DateTime.Today;

oQuoteBiz.SaveDataRow();
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform