Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
    Friend WithEvents DataSet11 As WindowsApplication6.DataSet1
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents lblTeller As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents deletecmd As System.Windows.Forms.Button
    Friend WithEvents updatecmd As System.Windows.Forms.Button
    Friend WithEvents newcmd As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter()
        Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection()
        Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.DataSet11 = New WindowsApplication6.DataSet1()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.TextBox2 = New System.Windows.Forms.TextBox()
        Me.lblTeller = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.deletecmd = New System.Windows.Forms.Button()
        Me.updatecmd = New System.Windows.Forms.Button()
        Me.newcmd = New System.Windows.Forms.Button()
        Me.Button3 = New System.Windows.Forms.Button()
        Me.Button4 = New System.Windows.Forms.Button()
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'OleDbDataAdapter1
        '
        Me.OleDbDataAdapter1.DeleteCommand = Me.OleDbDeleteCommand1
        Me.OleDbDataAdapter1.InsertCommand = Me.OleDbInsertCommand1
        Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
        Me.OleDbDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Gemeenten", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("Postcode", "Postcode"), New System.Data.Common.DataColumnMapping("Gemeente", "Gemeente")})})
        Me.OleDbDataAdapter1.UpdateCommand = Me.OleDbUpdateCommand1
        '
        'OleDbDeleteCommand1
        '
        Me.OleDbDeleteCommand1.CommandText = "DELETE FROM Gemeenten WHERE (Postcode = ?) AND (Gemeente = ? OR ? IS NULL AND Gem" & _
        "eente IS NULL)"
        Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Postcode", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, False, CType(5, Byte), CType(0, Byte), "Postcode", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Gemeente", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Gemeente", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Gemeente1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Gemeente", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=D:\school\" & _
        "visual basic\oefeningen\Bieren.mdb;Mode=Share Deny None;Extended Properties="""";J" & _
        "et OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Passwo" & _
        "rd="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global" & _
        " Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database " & _
        "Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=Fa" & _
        "lse;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Repli" & _
        "ca Repair=False;Jet OLEDB:SFP=False"
        '
        'OleDbInsertCommand1
        '
        Me.OleDbInsertCommand1.CommandText = "INSERT INTO Gemeenten(Postcode, Gemeente) VALUES (?, ?)"
        Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Postcode", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, False, CType(5, Byte), CType(0, Byte), "Postcode", System.Data.DataRowVersion.Current, Nothing))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Gemeente", System.Data.OleDb.OleDbType.VarWChar, 50, "Gemeente"))
        '
        'OleDbSelectCommand1
        '
        Me.OleDbSelectCommand1.CommandText = "SELECT Postcode, Gemeente FROM Gemeenten"
        Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
        '
        'OleDbUpdateCommand1
        '
        Me.OleDbUpdateCommand1.CommandText = "UPDATE Gemeenten SET Postcode = ?, Gemeente = ? WHERE (Postcode = ?) AND (Gemeent" & _
        "e = ? OR ? IS NULL AND Gemeente IS NULL)"
        Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Postcode", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, False, CType(5, Byte), CType(0, Byte), "Postcode", System.Data.DataRowVersion.Current, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Gemeente", System.Data.OleDb.OleDbType.VarWChar, 50, "Gemeente"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Postcode", System.Data.OleDb.OleDbType.SmallInt, 0, System.Data.ParameterDirection.Input, False, CType(5, Byte), CType(0, Byte), "Postcode", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Gemeente", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Gemeente", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Gemeente1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Gemeente", System.Data.DataRowVersion.Original, Nothing))
        '
        'DataSet11
        '
        Me.DataSet11.DataSetName = "DataSet1"
        Me.DataSet11.Locale = New System.Globalization.CultureInfo("nl-NL")
        Me.DataSet11.Namespace = "http://www.tempuri.org/DataSet1.xsd"
        '
        'TextBox1
        '
        Me.TextBox1.Location = New System.Drawing.Point(24, 96)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(96, 20)
        Me.TextBox1.TabIndex = 0
        Me.TextBox1.Text = "TextBox1"
        '
        'TextBox2
        '
        Me.TextBox2.Location = New System.Drawing.Point(152, 96)
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.Size = New System.Drawing.Size(104, 20)
        Me.TextBox2.TabIndex = 1
        Me.TextBox2.Text = "TextBox2"
        '
        'lblTeller
        '
        Me.lblTeller.Location = New System.Drawing.Point(296, 96)
        Me.lblTeller.Name = "lblTeller"
        Me.lblTeller.Size = New System.Drawing.Size(112, 24)
        Me.lblTeller.TabIndex = 2
        Me.lblTeller.Text = "lblTeller"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(240, 160)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(64, 32)
        Me.Button1.TabIndex = 3
        Me.Button1.Text = "volgende"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(152, 160)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(64, 32)
        Me.Button2.TabIndex = 4
        Me.Button2.Text = "vorige"
        '
        'deletecmd
        '
        Me.deletecmd.Location = New System.Drawing.Point(32, 24)
        Me.deletecmd.Name = "deletecmd"
        Me.deletecmd.Size = New System.Drawing.Size(72, 32)
        Me.deletecmd.TabIndex = 5
        Me.deletecmd.Text = "delete"
        '
        'updatecmd
        '
        Me.updatecmd.Location = New System.Drawing.Point(224, 24)
        Me.updatecmd.Name = "updatecmd"
        Me.updatecmd.Size = New System.Drawing.Size(72, 32)
        Me.updatecmd.TabIndex = 6
        Me.updatecmd.Text = "update"
        '
        'newcmd
        '
        Me.newcmd.Location = New System.Drawing.Point(128, 24)
        Me.newcmd.Name = "newcmd"
        Me.newcmd.Size = New System.Drawing.Size(72, 32)
        Me.newcmd.TabIndex = 7
        Me.newcmd.Text = "add"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(72, 160)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(64, 32)
        Me.Button3.TabIndex = 8
        Me.Button3.Text = "eerste"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(320, 160)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(64, 32)
        Me.Button4.TabIndex = 9
        Me.Button4.Text = "laatste"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(416, 237)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button4, Me.Button3, Me.newcmd, Me.updatecmd, Me.deletecmd, Me.Button2, Me.Button1, Me.lblTeller, Me.TextBox2, Me.TextBox1})
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        DataSet11.Clear()
        OleDbDataAdapter1.Fill(DataSet11)
        Me.TextBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "gemeenten.PostCode"))
        Me.TextBox2.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "gemeenten.gemeente"))
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        lblTeller.Text = "Record " & _
Me.BindingContext(DataSet11, "gemeenten").Position + 1 & " van " & _
Me.BindingContext(DataSet11, "gemeenten").Count
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.BindingContext(DataSet11, "gemeenten").Position += 1
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.BindingContext(DataSet11, "gemeenten").Position -= 1

    End Sub

    Private Sub deletecmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles deletecmd.Click
        Me.BindingContext(DataSet11, "gemeenten").RemoveAt(Me.BindingContext(DataSet11, "gemeenten").Position)
    End Sub

    Private Sub newcmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles newcmd.Click
        Me.BindingContext(DataSet11, "gemeenten").AddNew()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.BindingContext(DataSet11, "gemeenten").Position = 0
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.BindingContext(DataSet11, "gemeenten").Position = Me.BindingContext(DataSet11, "gemeenten").Count - 1

    End Sub

    Private Sub updatecmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updatecmd.Click
        Me.Update()
    End Sub
End Class
