Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataRelation Prevent my DataSet Updates!!
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00758171
Message ID:
00758662
Views:
21
Yes, they have a PK but Iam not adding them to my dataset, should I add them to my dataset (parent table as PK and child table as FK)??


>I would look at your data and make sure both tables have a primary key.
>
>I would also make sure the ContinueUpdateOneError property of the DataAdapter is set to False. If you set this property to True and one or more of the update attempts fail, the DataAdapter will not throw an exception. When the DataAdapter encounters a failed update attempt, it will set the HasErrors property of the corresponding DataRow object to True and set the RowError property of the DataRow to the concurrency error message. You can check the HasErrors property of your DataSet or DataTable after calling DataAdapter.Update to determine whether any of the update attempts failed.
>
>
>>In that case I get un error message:
>>"Update unable to find TableMapping['Table'] or DataTable 'Table'.
>>
>>I need to spacefy the table name as I am doing.
>>
>>
>>
>>>Just a guess, Ahmad, since I haven't used either DataRelations or the da.Update(), but why don't you update the DataSet as opposed to the DataTable. So, you'd do this instead:
>>>
>>>
>>>da.Update(myDS)
>>>
>>>
>>>~~Bonnie
>>>
>>>
>>>>Hi All,
>>>>
>>>>I have 2 datatable in my dataset and have created a datarelation between the parent & child datatables.
>>>>
>>>>If I updated the parent table, the data saved fine, but if updated child table it updates fine (if one row in the relation) but if it has more than one row it egnores the update & does not give any error too. Usig this code:
>>>>
>>>>BindingContext(myDS, "Measure").EndCurrentEdit()
>>>>myMeasureDA.Update(myDS, "Measure")
>>>>myDS.AcceptChanges()
>>>>
>>>>
>>>>It woks fine if I removed the datarelation before the update !!!
>>>>
>>>>
>>>>myDS.Relations.Remove("MemMsr")
>>>>BindingContext(myDS, "Measure").EndCurrentEdit()
>>>>myMeasureDA.Update(myDS, "Measure")
>>>>myDS.AcceptChanges()
>>>>
>>>>But I need the relation, any one knows how to solve this essue.
>>>>
>>>>Note: I am using CommandBuilder, & MSDE as backend database
>>>>
>>>>Thanks for the help
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform