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 txtFirstName As System.Windows.Forms.TextBox
    Friend WithEvents txtLastName As System.Windows.Forms.TextBox
    Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
    Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
    Friend WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
    Friend WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
    Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
    Friend WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
    Friend WithEvents DataSet11 As Przegladarka.DataSet1
    Friend WithEvents btnPrevious As System.Windows.Forms.Button
    Friend WithEvents btnNext As System.Windows.Forms.Button
    Friend WithEvents lblDataStatus As System.Windows.Forms.Label
    Friend WithEvents btnDelete As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents btnNew As System.Windows.Forms.Button
    Friend WithEvents btnFirst As System.Windows.Forms.Button
    Friend WithEvents btnLast As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.txtFirstName = New System.Windows.Forms.TextBox
        Me.DataSet11 = New Przegladarka.DataSet1
        Me.txtLastName = New System.Windows.Forms.TextBox
        Me.btnPrevious = New System.Windows.Forms.Button
        Me.btnNext = New System.Windows.Forms.Button
        Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
        Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
        Me.btnFirst = New System.Windows.Forms.Button
        Me.btnLast = New System.Windows.Forms.Button
        Me.lblDataStatus = New System.Windows.Forms.Label
        Me.btnDelete = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnNew = New System.Windows.Forms.Button
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'txtFirstName
        '
        Me.txtFirstName.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "tblKlienci.Imie"))
        Me.txtFirstName.Location = New System.Drawing.Point(48, 48)
        Me.txtFirstName.Name = "txtFirstName"
        Me.txtFirstName.Size = New System.Drawing.Size(168, 20)
        Me.txtFirstName.TabIndex = 0
        Me.txtFirstName.Text = ""
        '
        'DataSet11
        '
        Me.DataSet11.DataSetName = "DataSet1"
        Me.DataSet11.Locale = New System.Globalization.CultureInfo("pl-PL")
        '
        'txtLastName
        '
        Me.txtLastName.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "tblKlienci.Nazwisko"))
        Me.txtLastName.Location = New System.Drawing.Point(48, 80)
        Me.txtLastName.Name = "txtLastName"
        Me.txtLastName.Size = New System.Drawing.Size(168, 20)
        Me.txtLastName.TabIndex = 1
        Me.txtLastName.Text = ""
        '
        'btnPrevious
        '
        Me.btnPrevious.Location = New System.Drawing.Point(88, 152)
        Me.btnPrevious.Name = "btnPrevious"
        Me.btnPrevious.TabIndex = 2
        Me.btnPrevious.Text = "Wstecz"
        '
        'btnNext
        '
        Me.btnNext.Location = New System.Drawing.Point(168, 152)
        Me.btnNext.Name = "btnNext"
        Me.btnNext.TabIndex = 3
        Me.btnNext.Text = "Dalej"
        '
        'SqlSelectCommand1
        '
        Me.SqlSelectCommand1.CommandText = "SELECT ID, Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocztowy, Telefo" & _
        "n, Faks, Email FROM tblKlienci"
        Me.SqlSelectCommand1.Connection = Me.SqlConnection1
        '
        'SqlConnection1
        '
        Me.SqlConnection1.ConnectionString = "workstation id=WER;packet size=4096;integrated security=SSPI;data source=WER;pers" & _
        "ist security info=True;initial catalog=Nowinki"
        '
        'SqlInsertCommand1
        '
        Me.SqlInsertCommand1.CommandText = "INSERT INTO tblKlienci(Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocz" & _
        "towy, Telefon, Faks, Email) VALUES (@Imie, @Nazwisko, @Firma, @Adres, @Miasto, @" & _
        "Wojewodztwo, @KodPocztowy, @Telefon, @Faks, @Email); SELECT ID, Imie, Nazwisko, " & _
        "Firma, Adres, Miasto, Wojewodztwo, KodPocztowy, Telefon, Faks, Email FROM tblKli" & _
        "enci WHERE (ID = @@IDENTITY)"
        Me.SqlInsertCommand1.Connection = Me.SqlConnection1
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Imie", System.Data.SqlDbType.VarChar, 20, "Imie"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Nazwisko", System.Data.SqlDbType.VarChar, 30, "Nazwisko"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Firma", System.Data.SqlDbType.VarChar, 50, "Firma"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Adres", System.Data.SqlDbType.VarChar, 50, "Adres"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Miasto", System.Data.SqlDbType.VarChar, 30, "Miasto"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Wojewodztwo", System.Data.SqlDbType.VarChar, 3, "Wojewodztwo"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@KodPocztowy", System.Data.SqlDbType.VarChar, 6, "KodPocztowy"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Telefon", System.Data.SqlDbType.VarChar, 15, "Telefon"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Faks", System.Data.SqlDbType.VarChar, 15, "Faks"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.VarChar, 100, "Email"))
        '
        'SqlUpdateCommand1
        '
        Me.SqlUpdateCommand1.CommandText = "UPDATE tblKlienci SET Imie = @Imie, Nazwisko = @Nazwisko, Firma = @Firma, Adres =" & _
        " @Adres, Miasto = @Miasto, Wojewodztwo = @Wojewodztwo, KodPocztowy = @KodPocztow" & _
        "y, Telefon = @Telefon, Faks = @Faks, Email = @Email WHERE (ID = @Original_ID) AN" & _
        "D (Adres = @Original_Adres OR @Original_Adres IS NULL AND Adres IS NULL) AND (Em" & _
        "ail = @Original_Email OR @Original_Email IS NULL AND Email IS NULL) AND (Faks = " & _
        "@Original_Faks OR @Original_Faks IS NULL AND Faks IS NULL) AND (Firma = @Origina" & _
        "l_Firma OR @Original_Firma IS NULL AND Firma IS NULL) AND (Imie = @Original_Imie" & _
        " OR @Original_Imie IS NULL AND Imie IS NULL) AND (KodPocztowy = @Original_KodPoc" & _
        "ztowy OR @Original_KodPocztowy IS NULL AND KodPocztowy IS NULL) AND (Miasto = @O" & _
        "riginal_Miasto OR @Original_Miasto IS NULL AND Miasto IS NULL) AND (Nazwisko = @" & _
        "Original_Nazwisko OR @Original_Nazwisko IS NULL AND Nazwisko IS NULL) AND (Telef" & _
        "on = @Original_Telefon OR @Original_Telefon IS NULL AND Telefon IS NULL) AND (Wo" & _
        "jewodztwo = @Original_Wojewodztwo OR @Original_Wojewodztwo IS NULL AND Wojewodzt" & _
        "wo IS NULL); SELECT ID, Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPo" & _
        "cztowy, Telefon, Faks, Email FROM tblKlienci WHERE (ID = @ID)"
        Me.SqlUpdateCommand1.Connection = Me.SqlConnection1
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Imie", System.Data.SqlDbType.VarChar, 20, "Imie"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Nazwisko", System.Data.SqlDbType.VarChar, 30, "Nazwisko"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Firma", System.Data.SqlDbType.VarChar, 50, "Firma"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Adres", System.Data.SqlDbType.VarChar, 50, "Adres"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Miasto", System.Data.SqlDbType.VarChar, 30, "Miasto"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Wojewodztwo", System.Data.SqlDbType.VarChar, 3, "Wojewodztwo"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@KodPocztowy", System.Data.SqlDbType.VarChar, 6, "KodPocztowy"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Telefon", System.Data.SqlDbType.VarChar, 15, "Telefon"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Faks", System.Data.SqlDbType.VarChar, 15, "Faks"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.VarChar, 100, "Email"))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Adres", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Adres", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Email", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Faks", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Faks", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Firma", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Firma", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Imie", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Imie", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_KodPocztowy", System.Data.SqlDbType.VarChar, 6, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "KodPocztowy", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Miasto", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Miasto", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Nazwisko", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Nazwisko", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Telefon", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Telefon", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Wojewodztwo", System.Data.SqlDbType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Wojewodztwo", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"))
        '
        'SqlDeleteCommand1
        '
        Me.SqlDeleteCommand1.CommandText = "DELETE FROM tblKlienci WHERE (ID = @Original_ID) AND (Adres = @Original_Adres OR " & _
        "@Original_Adres IS NULL AND Adres IS NULL) AND (Email = @Original_Email OR @Orig" & _
        "inal_Email IS NULL AND Email IS NULL) AND (Faks = @Original_Faks OR @Original_Fa" & _
        "ks IS NULL AND Faks IS NULL) AND (Firma = @Original_Firma OR @Original_Firma IS " & _
        "NULL AND Firma IS NULL) AND (Imie = @Original_Imie OR @Original_Imie IS NULL AND" & _
        " Imie IS NULL) AND (KodPocztowy = @Original_KodPocztowy OR @Original_KodPocztowy" & _
        " IS NULL AND KodPocztowy IS NULL) AND (Miasto = @Original_Miasto OR @Original_Mi" & _
        "asto IS NULL AND Miasto IS NULL) AND (Nazwisko = @Original_Nazwisko OR @Original" & _
        "_Nazwisko IS NULL AND Nazwisko IS NULL) AND (Telefon = @Original_Telefon OR @Ori" & _
        "ginal_Telefon IS NULL AND Telefon IS NULL) AND (Wojewodztwo = @Original_Wojewodz" & _
        "two OR @Original_Wojewodztwo IS NULL AND Wojewodztwo IS NULL)"
        Me.SqlDeleteCommand1.Connection = Me.SqlConnection1
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Adres", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Adres", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Email", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Email", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Faks", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Faks", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Firma", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Firma", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Imie", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Imie", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_KodPocztowy", System.Data.SqlDbType.VarChar, 6, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "KodPocztowy", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Miasto", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Miasto", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Nazwisko", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Nazwisko", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Telefon", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Telefon", System.Data.DataRowVersion.Original, Nothing))
        Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_Wojewodztwo", System.Data.SqlDbType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Wojewodztwo", System.Data.DataRowVersion.Original, Nothing))
        '
        'SqlDataAdapter1
        '
        Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1
        Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
        Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
        Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblKlienci", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("ID", "ID"), New System.Data.Common.DataColumnMapping("Imie", "Imie"), New System.Data.Common.DataColumnMapping("Nazwisko", "Nazwisko"), New System.Data.Common.DataColumnMapping("Firma", "Firma"), New System.Data.Common.DataColumnMapping("Adres", "Adres"), New System.Data.Common.DataColumnMapping("Miasto", "Miasto"), New System.Data.Common.DataColumnMapping("Wojewodztwo", "Wojewodztwo"), New System.Data.Common.DataColumnMapping("KodPocztowy", "KodPocztowy"), New System.Data.Common.DataColumnMapping("Telefon", "Telefon"), New System.Data.Common.DataColumnMapping("Faks", "Faks"), New System.Data.Common.DataColumnMapping("Email", "Email")})})
        Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
        '
        'btnFirst
        '
        Me.btnFirst.Location = New System.Drawing.Point(8, 152)
        Me.btnFirst.Name = "btnFirst"
        Me.btnFirst.TabIndex = 4
        Me.btnFirst.Text = "Pierwszy"
        '
        'btnLast
        '
        Me.btnLast.Location = New System.Drawing.Point(248, 152)
        Me.btnLast.Name = "btnLast"
        Me.btnLast.TabIndex = 5
        Me.btnLast.Text = "Ostatni"
        '
        'lblDataStatus
        '
        Me.lblDataStatus.Location = New System.Drawing.Point(16, 192)
        Me.lblDataStatus.Name = "lblDataStatus"
        Me.lblDataStatus.Size = New System.Drawing.Size(304, 24)
        Me.lblDataStatus.TabIndex = 6
        '
        'btnDelete
        '
        Me.btnDelete.Location = New System.Drawing.Point(248, 96)
        Me.btnDelete.Name = "btnDelete"
        Me.btnDelete.TabIndex = 12
        Me.btnDelete.Text = "Usuń"
        '
        'btnCancel
        '
        Me.btnCancel.Location = New System.Drawing.Point(248, 64)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.TabIndex = 11
        Me.btnCancel.Text = "Anuluj"
        '
        'btnNew
        '
        Me.btnNew.Location = New System.Drawing.Point(248, 32)
        Me.btnNew.Name = "btnNew"
        Me.btnNew.TabIndex = 10
        Me.btnNew.Text = "Nowy"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(344, 229)
        Me.Controls.Add(Me.btnDelete)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.btnNew)
        Me.Controls.Add(Me.lblDataStatus)
        Me.Controls.Add(Me.btnLast)
        Me.Controls.Add(Me.btnFirst)
        Me.Controls.Add(Me.btnNext)
        Me.Controls.Add(Me.btnPrevious)
        Me.Controls.Add(Me.txtLastName)
        Me.Controls.Add(Me.txtFirstName)
        Me.Name = "Form1"
        Me.Text = "Przeglądarka danych"
        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
        ' Usunąć komentarze z następnych czterech wierszy, aby odwrócić kolejność wiązania
        '  txtFirstName.DataBindings.Clear()
        '  txtLastName.DataBindings.Clear()
        '  txtFirstName.DataBindings.Add("Text", DataSet11, "tblKlienci.Nazwisko")
        '  txtLastName.DataBindings.Add("Text", DataSet11, "tblKlienci.Imie")

        SqlDataAdapter1.Fill(DataSet11)
        ShowDataStatus()
    End Sub

    Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
        Me.BindingContext(DataSet11, "tblKlienci").Position -= 1
        SqlDataAdapter1.Update(DataSet11)
        ShowDataStatus()
    End Sub

    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        Me.BindingContext(DataSet11, "tblKlienci").Position += 1
        SqlDataAdapter1.Update(DataSet11)
        ShowDataStatus()
    End Sub
    Private Sub ShowDataStatus()
        With Me.BindingContext(DataSet11, "tblKlienci")
            lblDataStatus.Text = "Rekord " & .Position + 1 & " z " & .Count
        End With
    End Sub
    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
        Me.BindingContext(DataSet11, "tblKlienci").AddNew()
        txtFirstName.Focus()
        ShowDataStatus()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.BindingContext(DataSet11, "tblKlienci").CancelCurrentEdit()
        ShowDataStatus()
    End Sub
    Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        If MsgBox("Hej, czy aby na pewno?", MsgBoxStyle.YesNo, "Usuwanie rekordu") = MsgBoxResult.Yes Then
            With Me.BindingContext(DataSet11, "tblKlienci")
                .RemoveAt(.Position)
            End With
        End If
        ShowDataStatus()
        SqlDataAdapter1.Update(DataSet11)
    End Sub
    Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
        Me.BindingContext(DataSet11, "tblKlienci").Position = 0
        SqlDataAdapter1.Update(DataSet11)
        ShowDataStatus()
    End Sub

    Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
        With Me.BindingContext(DataSet11, "tblKlienci")
            .Position = .Count
        End With
        SqlDataAdapter1.Update(DataSet11)
        ShowDataStatus()
    End Sub
End Class
