开发者

silverlight datacontext, repeats all the past commands/action each time a new action is performed on it

开发者 https://www.devze.com 2023-02-20 03:59 出处:网络
a datacontext defined in a module(domain services ado.net ria) a page having add/delete methods whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DEL
  • a datacontext defined in a module(domain services ado.net ria)
  • a page having add/delete methods

  • whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DELETION OF RECORDS) are carried out before the new action is carried out

normally

  • this behaviour is not prominent but开发者_JAVA技巧

  • "when using break points and inspecting the values of the variables and table object to be added to context, it is clear that all the previous actions take place again.

edit

  • even when the datacotext. savechanges is called, even after that still all actions carried out on the datacontext repeat themseleves, when any new action is to be carried out


got the problem

was creating a new instance of the usercontrol every time, therefore all the instances did there work when asked to add record to context....

solution

  • just declare the instance of the usercontrol once in the constructor of the main page.
  • then use that declaration where ever needed.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号