Imports System.Data.OleDb
Public Class addlabor
Private Sub addlabor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconnection As OleDbConnection = New OleDbConnection()
myconnection.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=c:\AccessDatabase.mdb"
myconnection.Open()
Dim statement As String
statement = "insert into labor(laborcode,namelabor,surname,department,company,phone,position,email,status,address) values('" & laborcode.Text & "','" & namelabor.Text & "','" & surname.Text & "','" & department.Text & "','" & company.Text & "','" & phone.Text & "','" & position.Text & "','" & email.Text & "','" & status.Text & "','" & address.Text & "')"
Dim mycommand As OleDb.OleDbCommand
mycommand = New OleDbCommand(statement, myconnection)
mycommand.ExecuteNonQuery()
myconnection.Close()
End Sub
End Class