我是在窗体加载程序下写 Form1_Load
timer1.Enabled = true;
timer1.Interval = 2000;
然后在time事件中这样写的timer1_Tick(){
string strcon = "Data Source=aa;user=test;password=test;";OracleConnection orlcon = newOracleConnection(strcon); orlcon.Open();
//输出名称
while (orlreader4.Read()){this.ybnextname.Text = orlreader4[0].ToString(); } }
finally{ strcon.Clone(); }}