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

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
 
S

Scott Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top