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 32 33 34 35 36 37 38
| Imports System.Data
Imports System.Data.SqlClient
Imports System.ArgumentOutOfRangeException
Public Class Form1
Private cs As New SqlConnection("Data Source=OUSSAMA-PC\SQLEXPRESS;Initial Catalog=test;Integrated Security=True")
Private da As New SqlDataAdapter("select * from carte", cs)
Private ds As New DataSet
Private cmb As New SqlCommandBuilder(da)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO : cette ligne de code charge les données dans la table 'TestDataSet.carte'. Vous pouvez la déplacer ou la supprimer selon vos besoins.
Me.CarteTableAdapter.Fill(Me.TestDataSet.carte)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
da.UpdateCommand = cmb.GetUpdateCommand
da.Update(ds.Tables("carte"))
End Sub
End Class
Public Class ArgumentNullException
Inherits ArgumentException
Dim instance As ArgumentNullException
End Class |
Partager