奇怪的事情,应该是bug吧?
cat54 2003-08-22 10:52:52 我做了一个控件名为uc1,里面用timer 控件控制函数
readpic
定义如下
Private Sub readpic()
Dim bt(0) As Byte
Dim dap As New SqlDataAdapter("select * from manonline where snp='2'", con)
‘con为sqlserverconnection,已经打开
Dim ds As New DataSet()
ds.Clear()
dap.Fill(ds)
Dim i As Integer
For i = 0 To ds.Tables(0).Rows.Count - 1
If ds.Tables(0).Rows.Count > 0 Then
Dim com As New SqlCommand("update manonline set snp='0'where snp='2'", con)
com.ExecuteNonQuery()
Button2.Text = "canreadpic"
End If
Next
End Sub
在调用控件的form1里面将会看到,如果没有
Dim com As New SqlCommand("update manonline set snp='0'where snp='2'", con)
com.ExecuteNonQuery()
那么button2.text就能够变化,反之如果有以上两句就不会变化。
真是奇怪啊