vb.net - Object reference not set to an instance when retrieving from datatable -
i working on application, wherein have datatables.these datatablesare global , store data in memory regarding important tables .throughout application statement such object = gobjclsvariable.datatable.select(whereclause)
has been used retrieve desired data , when required based on clause.the application structure such when broadcast received ,the data update in the database tables , these global datatables made again using select queries on database tables.the problem arises when trying retrieve object returned global datatable @ instance when global datatable being updated.further add,the retrieving of information global datatable has been done @ numerous places, can invoked simultaneously application.
use property rather field , synchronise access object synclock blocks. thread trying property value have wait if thread setting it.
you use readerwriterlock instead if wanted, allow multiple threads property value @ same time other threads excluded access if thread setting it.
Comments
Post a Comment