Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a new record
Message
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Adding a new record
Miscellaneous
Thread ID:
00801021
Message ID:
00801021
Views:
54
I'm retrofitting an ASP.NET application to the framwork. I'm trying to write some code so the user can add a record. If the user comes into the form in add mode (myform.aspx?AddNew=true) it works fine. If the user is in the form editing an existing record, then trys to add a new record, it crashes.

In my add routine I use GetEmptyDataSet then add a NewRow.

DataSet dsProject = this.boProject.GetEmptyDataSet();
this.boProject.NewRow();

When the form loads in add mode the GetEmptyDataSet call goes fine because in the CallStateChange method StateChange property is null. On the postback the property is set to "Retrieved" and the two-way bound controls on the page try to load throwing the exception "There is no row at position 0."

I'm loading a new bizobj into this.boProject every time the page loads whether it's a postback or not.
this.boProject = (Project)this.RegisterPrimaryBizObj(new Project());
Rip Ryness
International Falls, MN
Next
Reply
Map
View

Click here to load this message in the networking platform