You must synchronize any write operations... Meaning.......

  • Thread starter Thread starter Hewit
  • Start date Start date
H

Hewit

DataTable Class documentation says.
Thread Safety
"This type is safe for multithreaded read operations. You must synchronize
any write operations."

In my web based application (ASP.Net) developed using Vb.Net on .Net
Framework 1.1. can I write a function which will populate an object(derived
from DataTable Class)? Since it is web based application and because of
multiple user there is a possibality of hitting this function by multiple
users at the same time.

But the documentation says "You must synchronize any write operations".

Please advice.

Smith
 
Smith:

How do you plan to use the DataTable? That's the important questions to answer.


A typical use is to create a DataTable during a page's Load event, perhaps
add some records into the table from the database, and then bind it to a
data grid. After this, the instance is never used again. In these cases a
single instance will never see multiple threads or multiple users.

If instead you keep the DataTable in the Application object, or the Cache
object, or in a static field, then the object is accesible to multiple users
& multiple threads, and synchronization is needed.
 
Back
Top