1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <%@ Page Language="VB" AutoEventWireup="false" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Private Sub page_load()
End Sub
Protected Sub Btn_envoi_msg_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' Connection à la base de données
Dim cn As New SqlConnection()
cn.ConnectionString = ConfigurationSettings.AppSettings("WTS_ExtraSQL")
cn.Open()
Dim CommandText As String
CommandText = "INSERT INTO wts_messagerie_interne(expediteur,destinateur,objet,contenu_message) VALUES ('" & txtExp.Text & "', '" & txtDest.Text & "', '" & txtObj.Text & "', '" & txtExp.Text & "')"
Dim InsSQL As New SqlCommand(CommandText, cn)
Dim x As Integer
Try
x = InsSQL.ExecuteNonQuery()
Response.Write("Insertion d'un agent" & "<br />")
Catch ex As Exception
Response.Write(ex)
End Try
InsSQL = Nothing
End Sub
Protected Sub Btn_annul_envoi_Click(ByVal sender As Object, ByVal e As System.EventArgs)
end sub
</script> |
Partager