每隔几百次,我就会在生命网站上发现一个错误,即输掉对象。 我一直在检查,测试和测试,但还没有弄清楚什么是错误的。 有人有什么好主意吗?
代码为:
Dim MySqlCommand = New MySqlCommand(SQLC, MySqlConnect)
Try
Tries = 5
lg &= " Co("
Do
Try : MySqlCommand.Connection.Open()
Catch ex As Exception
lg &= " " & ex.Message
Wait(0.5)
End Try
If (MySqlCommand.Connection.State <> ConnectionState.Open) Then Tries -= 1
Loop While Tries > 0 And MySqlCommand.Connection.State <> ConnectionState.Open
lg &= ")"
Catch ex As Exception
lg &= ex.message
End Try
lg &= " " & LCase(Left(SQLC, 5)) & "(Mc"
Try
lg &= "En" : Dim ret = MySqlCommand.ExecuteNonQuery()
lg = ""
Catch ex As Exception
lg &= ":" & ex.message
End Try
if lg<>"" then Response.write(lg)
输出为:
Co()updat(McEn:对象引用未设置为对象的实例。