Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataRelation Prevent my DataSet Updates!!
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00758171
Message ID:
00760501
Vues:
22
This message has been marked as the solution to the initial question of the thread.
Cathi :-)

Your words gided me to the solution...
I am not using the Child DataTable instead of the relation object, I am using the relation object. But the misstake I was making is while updating the DataAdapter I was using the Child DataTable here like this:
Me.BindingContext(myDS, "Measure").EndCurrentEdit()
myMeasureDA.Update(myDS, "Measure")
While I should EndCurrentEdit for the relation object then update the child table like this :
Me.BindingContext(myDS, "Member.MemMsr").EndCurrentEdit()
myMeasureDA.Update(myDS, "Measure")
Thank you very very much...



>The child datagrid should have the DataMember set to the relation and not the child DataTable. That way, ADO.NET knows how to get the subset of records. It appears that you are working with the Child DataTable instead of the relation object. Your Child DataTable will never match with record count with your relation since the relation is a subset view of your child records.
>
>>No Cathi,
>>Everything is working fine, but assume the child table has 12 rows as total, when I move the parent table to lets say 2nd row the child table will move and display the related rows and display them in the datagrid, now assume the displayed rows in datagrid there position in the dataset as 7 and 8 in the datagrid if I used this code MsgBox(Me.dgMeasurements.CurrentRowIndex) they will be 0 and 1 which is true according to what is displayed in datagrid, so if I used the below code:
>>
>>Me.BindingContext(myDS, "Measure").Position = Me.dgMeasurements.CurrentRowIndex
>>
>>to point the selected row in datagrid to it's source row in dataset will not work becuase in dataset it's postion 7 and datagrid it's .CurrentRowIndex is 0, I want to know if you can suggest somthing to fix this please.
>>
>>
>>
>>
>>>The datagrid will change when you move the parent record. That is what you want, I assume. The datagrid for the child records will reset to the top when you change the parent. You would need to manually change it to another row if that is what you want.
>>>
>>>>I get it to work for the first row, by using the following code:
>>>>
>>>>Me.BindingContext(myDS, "Measure").Position = Me.dgMeasurements.CurrentRowIndex
>>>>
>>>>
>>>>it works for the first row in the parent table, but I moved to the next row in the parent table, .CurrentRowIndex does not match the correct position in the datagrid, because there is a relation between the parent & child table so eveytime the selected row in the parent table changed the number of rows in the datagrid changed according to the no. of rows in child table so evertime the datagrid .CurrentRowIndex will strart from "0".
>>>>
>>>>Cathi, do you suggest another method to use?
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform