Le code
tarik
-
madmyke Messages postés 60718 Date d'inscription Statut Modérateur Dernière intervention -
madmyke Messages postés 60718 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour,
Imports System.Data.OleDb
Public Class Form1
Dim mDataPath As String
Private Function GetConnection() As OleDb.OleDbConnection
'return a new connection to the database
Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & mDataPath & "d:\school.mdb")
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim con As OleDb.OleDbConnection = GetConnection()
Dim cmd_update As New OleDbCommand()
cmd_update = New OleDbCommand("UPDATE Article SET inventaire=inventaire-('" & CInt(txtinven.Text) & "') WHERE id=('" & CInt(Txtid.Text) & "')", con)
con.Open()
cmd_update.Connection = con
cmd_update.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Imports System.Data.OleDb
Public Class Form1
Dim mDataPath As String
Private Function GetConnection() As OleDb.OleDbConnection
'return a new connection to the database
Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & mDataPath & "d:\school.mdb")
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim con As OleDb.OleDbConnection = GetConnection()
Dim cmd_update As New OleDbCommand()
cmd_update = New OleDbCommand("UPDATE Article SET inventaire=inventaire-('" & CInt(txtinven.Text) & "') WHERE id=('" & CInt(Txtid.Text) & "')", con)
con.Open()
cmd_update.Connection = con
cmd_update.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
A voir également:
- Le code
- Code ascii - Guide
- Comment déverrouiller un téléphone quand on a oublié le code - Guide
- Code puk bloqué - Guide
- Code activation windows 10 - Guide
- Scanner qr code pc - Guide