Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ver. 1.1 NewRow() changes?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00866777
Message ID:
00866839
Vues:
21
>It's close, Now what do I return? When I look for a dataset with the new row added I can't find one? when I try :
>public DataSet GetEmptyApplication()
>{
>this.SetCurrentDataSet(this.GetEmptyDataSet());
>this.NewRow();
>return this.GetCurrentDataSet();
>}
>
>via this call:
>// Get a DataSet containing Empty Model
>DataSet dsGetModel = this.oIndxModel.GetEmptyApplication();
>
>

>I get this error on the page:
>Object reference not set to an instance of an object.
>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>
>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
>
>
>Which I translate to mean that I didn't get a dataset back.

We also had to switch to the datarow, but found it was pretty handy. If you don't want to use the datarow, you can get the dataset by:

DataRow dr = this.NewRow();
DataSet ds = dr.Table.DataSet;

This should give you the correct dataset.

Hope it helps,
Rex A. Willis MCSD
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform