程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> messagebox-第2個MSGBOX提示框沒有彈出來,請幫忙看看。

messagebox-第2個MSGBOX提示框沒有彈出來,請幫忙看看。

編輯:編程綜合問答
第2個MSGBOX提示框沒有彈出來,請幫忙看看。

代碼如下:已經更新成功了,但是卻沒有提示。第一個msgbox在為空時候可以提示的。就是在TRY裡面的不會提示。 換成MESSAGEBOX.SHOW也不行。
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox8.Text = "" Or TextBox9.Text = "" Or MaskedTextBox1.Text = "" Then
MsgBox("Please input above")
End If
Dim mycn As New SqlClient.SqlConnection
Dim mycom As New SqlClient.SqlCommand
mycn.ConnectionString = "Data Source=192.168.0.215;Initial Catalog=blue;uid=sa;pwd=Wks123"
mycom.CommandText = " Update KnitC set Cleaner ='" & MaskedTextBox1.Text & "' where substring(filenm,1,4)='" & TextBox8.Text & "' and substring(filenm,charindex('.',FileNM)+1,LEN(fileNM)-charindex('.',fileNM))='" & TextBox9.Text & "'"
mycom.Connection = mycn
Try
mycn.Open()
Dim mysqlreader As Data.SqlClient.SqlDataReader = mycom.ExecuteReader
If mycom.ExecuteNonQuery > 0 Then
MsgBox("Save success")
Else
MsgBox("Save Fail")
End If

    Catch ex As Exception

    Finally
        mycn.Close()
    End Try
End Sub

最佳回答:


直接把判斷去掉 ,放到 catch ex as exception 裡面 了。。實在是沒有其他辦法。。。說判斷裡面根本就不執行。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved