進口System.Data 進口System.Data.Odbc我想要顯示成功插入數據到數據庫後的客戶端消息..所以如何實現這個使用alert()消息在JavaScript?
分部類ADD_Employee 繼承System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cons, query As String
Dim con As OdbcConnection
Dim cmd As OdbcCommand
cons = "dsn=Courier; UID=Courier; PWD=123;"
con = New OdbcConnection(cons)
con.Open()
If (RadioButton1.Checked) Then
query = "insert into EMPLOYEE values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & "Male" & "','" & TextBox6.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"
cmd = New OdbcCommand(query, con)
cmd.ExecuteNonQuery()
End If
If (RadioButton2.Checked) Then
query = "insert into EMPLOYEE values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & "Female" & "','" & TextBox6.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"
cmd = New OdbcCommand(query, con)
cmd.ExecuteNonQuery()
End If
con.Close()
End Sub
末級
非常感謝......它鍋... –
@PramodLokare歡迎您考慮採取它作爲答案! –