1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btajoutermarche.Click
Dim conn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Try
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=F:\Documents\Visual Studio 2008\Projects\CCG\CCG\dbccw.mdb"
conn.Open()
cmd.Connection = conn
cmd.CommandText = "insert into marches (nommarche,civiliteresponsable,nomresponsable,prenomresponsable,adresseresponsable,cpresponsable,villeresponsable) values('" + tbnommarche.Text + "','" + tbciviliteresponsable.Text + "','" + tbnomresponsable.Text + "','" + tbrenomresponsable.Text + "','" + tbadresseresponsable.Text + "','" + tbcpresponsable.Text + "','" + tbvilleresponsable.Text + "')"
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message + " !! NON EXECUTE !!")
If conn IsNot Nothing Then
conn.Close()
End If
End Try
MarchesTableAdapter.Fill(Me.DbccwDataSet.marches) |
Partager