If u are using any database then no need to explicitly handle it... as all the major DB handle it for you... if u are using a dataset then the most simple way of achieving it is by the use of a bool flag, or if u are using multithreadingh then make sure that the dataset is made a static variable.