Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
Questionformating (erease) USB Stick Pin
Martin#17-Oct-06 21:47
Martin#17-Oct-06 21:47 
QuestionProblem abt threading!! Pin
samtam17-Oct-06 21:31
samtam17-Oct-06 21:31 
AnswerRe: Problem abt threading!! Pin
Guffa17-Oct-06 21:47
Guffa17-Oct-06 21:47 
GeneralRe: Problem abt threading!! Pin
samtam17-Oct-06 22:04
samtam17-Oct-06 22:04 
AnswerRe: Problem abt threading!! Pin
Guffa17-Oct-06 22:11
Guffa17-Oct-06 22:11 
GeneralRe: Problem abt threading!! Pin
samtam17-Oct-06 22:16
samtam17-Oct-06 22:16 
AnswerRe: Problem abt threading!! Pin
Guffa17-Oct-06 22:25
Guffa17-Oct-06 22:25 
GeneralRe: Problem abt threading!! Pin
samtam17-Oct-06 23:24
samtam17-Oct-06 23:24 
its not possible to send u the whole code related to this coz its too long so only sending u chunks from it,i hope it will help u to understand our problem

//this method is called after every 10 seconds by timer event
public void ConnectDB(Object obj, EventArgs ev)
{
myTimer.Stop();

String query = "/////////////some selection from DB";
aReader = DB.ExecuteReader(query);
projectDB.Clear();
while (aReader.Read())
{
//structure is a Struct containing a string and an int variable
//after gettings latest values from db in structure v add it
// in projectDB arraylist
structure.proj_name = aReader.GetString(0);
structure.compl_status = aReader.GetInt32(1);

//to lock the projectDB array list here
Monitor.Enter(projectDB);

projectDB.Add(structure);

//to unlock the projectDB arraylist here
Monitor.Exit(projectDB);

}

DB.Close();


if (!list_status.Contains(s))//some check i think u dnt need to understand it
{
exit_flag = true;//to disable timer
}
else
{
myTimer.Enabled = true;//to enable timer
}
}


another method of the same class that is using value of this arraylist
///////////////code where v r reading values from projectDB
if (Monitor.TryEnter(projectDB))
{
//projectDB is an arraylist filled with info from database

temp_projDB = (compile_status)projectDB[index];
}
else
continue;

//////////////////
Thanks
AnswerRe: Problem abt threading!! Pin
Guffa18-Oct-06 1:57
Guffa18-Oct-06 1:57 
Questionuninstalling windows services Pin
DownBySpj17-Oct-06 21:17
DownBySpj17-Oct-06 21:17 
AnswerRe: uninstalling windows services Pin
sundar15618-Oct-06 8:15
sundar15618-Oct-06 8:15 
QuestionReflections Pin
ParagGupta17-Oct-06 20:59
ParagGupta17-Oct-06 20:59 
AnswerRe: Reflections Pin
Nader Elshehabi17-Oct-06 21:16
Nader Elshehabi17-Oct-06 21:16 
QuestionNeed to know about prolog connectivity with C# application Pin
Ahsanzm17-Oct-06 20:43
Ahsanzm17-Oct-06 20:43 
QuestionParent-Child Forms : MDI Pin
IamHuM17-Oct-06 20:38
IamHuM17-Oct-06 20:38 
AnswerRe: Parent-Child Forms : MDI Pin
Martin#17-Oct-06 20:51
Martin#17-Oct-06 20:51 
AnswerRe: Parent-Child Forms : MDI Pin
sam#17-Oct-06 20:57
sam#17-Oct-06 20:57 
AnswerRe: Parent-Child Forms : MDI Pin
IamHuM17-Oct-06 21:23
IamHuM17-Oct-06 21:23 
GeneralRe: Parent-Child Forms : MDI Pin
Martin#17-Oct-06 21:31
Martin#17-Oct-06 21:31 
AnswerRe: Parent-Child Forms : MDI Pin
sam#17-Oct-06 21:56
sam#17-Oct-06 21:56 
QuestionMessenger ClassRoom Features Pin
nigam.aman17-Oct-06 20:36
nigam.aman17-Oct-06 20:36 
AnswerRe: Messenger ClassRoom Features Pin
Guffa17-Oct-06 20:48
Guffa17-Oct-06 20:48 
AnswerRe: Messenger ClassRoom Features Pin
Christian Graus17-Oct-06 22:10
protectorChristian Graus17-Oct-06 22:10 
Questionrnd number Pin
manjula reddy17-Oct-06 20:16
manjula reddy17-Oct-06 20:16 
AnswerRe: rnd number Pin
Guffa17-Oct-06 20:24
Guffa17-Oct-06 20:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.