c# static variables
<p>Greetings!</p>

<p>First let me explain my project in few words.I am using TouchServer which is a console application.TouchStation which is windows application.this does syncronization process.touchstation communicates with touchserver to create local database and load data from remote database.At the same time I can open TouchAdmin in browser which do all the CRUD ACTIONS and it communicate with TouchServer.Here we using dll files to communicate all these together like touchcommonlib,touchserverlib etc.and some tasklist running always.like watchdoc task,syncronizor task, touchserver task etc.</p>

<p>Now let me explain my problem,
The sync is running between server and station at the same time When we perform CRUD Operation  in TouchAdmin ,the action gets failed.if we not running touchstation it works fine.now i thot while performing crud operation in admin i stop all tasklist.but when i access tasklist the count shows 0 so i cannot stop the tasks.</p>

<p>I am writing the code to get the tasklist in syncronizer class as below.</p>

<pre><code>ThingzDB.ThingzDatabase.taskList1 = TouchStation.Program.taskList; //here i am getting all tasks in tasklist.
</code></pre>

<p>where tasklist1 is the static object i created in ThingzDb api. as below</p>

<pre><code>public static TouchCommonLib.Tasks.TaskList taskList1 = new TouchCommonLib.Tasks.TaskList();
</code></pre>

<p>now i will access this tasklist when the operartion method is POST which is done through touch admin.and this post method written in touchserverlib.</p>

<pre><code>if (ThingzDatabase.oper == 1)
{
    ThingzDB.ThingzDatabase.taskList1.StopAllTasks();

    ThingzDatabase.oper = 0;
}
</code></pre>

<p>but here i am getting the tasklist count as 0.</p>

<p>please anyone hellp me to find a solution for this.</p>

<p>Thank you</p>

<p>Jennie</p>

<p>Now  </p>
