Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to store id values temporarily and check whether it is present or not before?
C#
public void timer1_tick()
{
  retrieving ID values from DB
}
public void store_ID()
{
condition: check the id present in the ID list
  open a form;
else;
  dont open a form;
}
Posted
Updated 4-Jun-13 1:34am
v2

1 solution

C#
int tempID = 0;

public void timer1_tick()
{
    // retrieving ID values from DB
}
public void store_ID()
{
    // condition: check the id present in the ID list
    if (IDfromDatabase == tempID)
    {
        // open a form;
    }
    else
    {
        tempID = IDfromDatabase;
        // dont open a form;
    }
}
 
Share this answer
 
v2
Comments
riodejenris14 4-Jun-13 8:12am    
the ID list is more than 10 if the timer again loads the above code does'nt work.
chk out richard!!!! and thanks for ur interest....
Richard MacCutchan 4-Jun-13 8:35am    
Then use a List to keep all the items you need to compare against.
riodejenris14 4-Jun-13 8:49am    
Even if i save all the id is in list i dont know how to write condition to open chat form?
Richard MacCutchan 4-Jun-13 9:03am    
There are lots of chat samples around; Google will find them for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900