Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting weird row affect after saving new row
Message
De
07/02/2007 08:28:08
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01192399
Message ID:
01193171
Vues:
23
>Are you using FoxPro data or SQL Server data? FoxPro tends to be case sensitive.

I'm using Sql Server.
It's the Binding source property of the text box that is case sensitive, I guess.

>I'm having a hard time grasping the scenario...You mention both the Pur_item and Pur_Recv tables--which table is the problem occurring in? Do you have two tables used in a single business object. If so, have you created a relationship between the two tables. If you are using multiple tables each in their own business object have you established relationships between the two business objects?

Both of the tables, Pur_head and Pur_item, have their own business object:
..Public Sub New()
....Me.TableName = "pur_head"
....Me.PrimaryKey = "reqid"
....Me.DefaultCommandType = CommandType.Text
..End Sub

..Public Sub New()
....Me.TableName = "pur_item"
....Me.PrimaryKey = "itemid"
....Me.AutoSaveOnParentSaved = True
....Me.AutoCancelOnParentCancel = True
....Me.AutoDeleteOnParentDeleted = True
....Me.AutoEmptyOnParentAdded = True
....Me.ForeignParentKeyField = "ReqID"
....Me.RetrieveAutoIncrementPK = False
....Me.DefaultCommandType = CommandType.Text
..End Sub

There is no other relation than what is in this code.

I have the program first create a header row. That works.

Then I have the program create a line item row:
..Private Sub NewLineItem()
....'Create new line item record
....Me.oItems.NewRow(New PurItemDefaults(Me.oItems.Entity.itemid))
....Me.grdItemListing.NavigateData(mmNavigate.Last)

Now the user has to enter some more data. When that is finished the user clicks on the Save button:
..Private Sub SaveItemRec()
....Dim result As mmSaveDataResult = oItems.SaveDataSet(dsItems)

....If result <> mmSaveDataResult.RulesBroken Then
......'If line item saved all right, create receiver row
......'NewReceiver() 'This is commented out until line item fixed
......Me.lblMessLineItems2.Text = "Line Item saved."

At this point there is a new Pur_item record with the correct data in it at the last row of the table. Say it's ReqId is 12345.
However, the first row of the Pur_item table had it's original ReqId field (say 10000) changed to the new ReqId (12345) created in the new line item row.

There's the problem, why would the first record in the Pur_item table have it's ReqId changed?

Something in my code set up wrong?

Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform