Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force numeric entry?
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00746296
Message ID:
00748749
Views:
22
Thank you Cathi,

This is excellent point, but not this what I mean.
When a user open a Wform he will have his one DataAdapter & DataSet in his client side, what ever additions/updates his does will be saved in the DataSet & he will be able to see his updates only, BUT will not be able to see other users updates till he close the Wform and load it again so the DataSet will be re-generated.

What I’ll do, I’ll add an Re-Fresh procedure will be called whenever the user changes any thing in saved it, will go and update his current DataSet,

BR


>The best way is to used batched queries and tag on a select statement after the update statement. This will refresh the fields with the values from the back end like the timestamp. For example, set the UpdateCommand to the follwoing query:
>
>
>UPDATE [Order Details]
>     SET OrderID = ?, ProductID = ?, Quantity = ?, UnitPrice = ?
>     WHERE OrderID = ? AND ProductID = ? AND TSCol = ?;
>SELECT TSCol FROM [Order Details] WHERE OrderID = ? AND ProductID = ?
>
>
>In this example, the timestamp column (TSCol) will be updated from the backend table so that there is no concurrency issues when an update occurs in the future.
>
>>I see...
>>Cathi what about refreshing the dataset is there a way to do it, is my way is correct?
>>
>>
>>>Because of issues with the Command Builder, it should only be used when generating very simple queries. I would not recommend using it for updating for the problems you are experiencing. It doesn't handle concurrency very well.
>>>
>>>>I'm using CommandBuilder !
>>>>
>>>>
>>>>>You are experiencing this because of your SQL Update statement. Your statements must be able to handle concurrency issues. I would recommend using store procedures to perform your updates. You will have better control over how the updates occur.
>>>>>
>>>>>>Thank u Cathi,
>>>>>>
>>>>>>But I having this error,
>>>>>>"Error #5, Concurrency Violation:..."
>>>>>>and this happen when I add the new row then update my DS then try to modify it again!
>>>>>>I this I should Re-Fresh or Re-Fill the DS, if yes, that means I should do the Re-Fill after each add, delete or modify operation I do?
>>>>>>And will this code do the job:
>>>>>>
>>>>>> ' Update DataSet
>>>>>> Me.BindingContext(myDS, "Area").EndCurrentEdit()
>>>>>> myDA.Update(myDS, "Area")
>>>>>> myDS.AcceptChanges()
>>>>>>
>>>>>> ' Re-Fresh DataSet
>>>>>> myDS.Clear()
>>>>>> myDA.Fill(myDS, "TableName")
>>>>>>
>>>>>>Thanks again
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Previous
Reply
Map
View

Click here to load this message in the networking platform