暂时存储值? [英] Storing Values temporarily?
本文介绍了暂时存储值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何临时存储ID值并检查它是否存在?
public void timer1_tick()
{
从 DB
检索ID值 }
public void store_ID()
{
condition:check id存在 ID列表
打开一个表单;
其他;
不要打开表格;
}
解决方案
int tempID = 0 ;
public void timer1_tick()
{
// 从DB检索ID值
}
public void store_ID()
{
// 条件:检查ID列表中的ID
if (IDfromDatabase == tempID )
{
// 打开表单;
}
else
{
tempID = IDfromDatabase;
// 不要打开表单;
}
}
How to store id values temporarily and check whether it is present or not before?
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;
}
解决方案
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; } }
这篇关于暂时存储值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文