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 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 SiatkaDanych.DataSet1
    Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
        Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
        Me.DataSet11 = New SiatkaDanych.DataSet1
        Me.DataGrid1 = New System.Windows.Forms.DataGrid
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'SqlSelectCommand1
        '
        Me.SqlSelectCommand1.CommandText = "SELECT ID, Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocztowy, Telefo" & _
        "n, Faks, Email, NazwiskoSoundex FROM tblKlienci"
        Me.SqlSelectCommand1.Connection = Me.SqlConnection1
        '
        'SqlInsertCommand1
        '
        Me.SqlInsertCommand1.CommandText = "INSERT INTO tblKlienci(Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocz" & _
        "towy, Telefon, Faks, Email, NazwiskoSoundex) VALUES (@Imie, @Nazwisko, @Firma, @" & _
        "Adres, @Miasto, @Wojewodztwo, @KodPocztowy, @Telefon, @Faks, @Email, @NazwiskoSo" & _
        "undex); SELECT ID, Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocztow" & _
        "y, Telefon, Faks, Email, NazwiskoSoundex FROM tblKlienci 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"))
        Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@NazwiskoSoundex", System.Data.SqlDbType.VarChar, 4, "NazwiskoSoundex"))
        '
        '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, NazwiskoSoundex = @Nazwisko" & _
        "Soundex WHERE (ID = @Original_ID) AND (Adres = @Original_Adres OR @Original_Adre" & _
        "s IS NULL AND Adres IS NULL) AND (Email = @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 = @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 K" & _
        "odPocztowy IS NULL) AND (Miasto = @Original_Miasto OR @Original_Miasto IS NULL A" & _
        "ND Miasto IS NULL) AND (Nazwisko = @Original_Nazwisko OR @Original_Nazwisko IS N" & _
        "ULL AND Nazwisko IS NULL) AND (NazwiskoSoundex = @Original_NazwiskoSoundex OR @O" & _
        "riginal_NazwiskoSoundex IS NULL AND NazwiskoSoundex IS NULL) AND (Telefon = @Ori" & _
        "ginal_Telefon OR @Original_Telefon IS NULL AND Telefon IS NULL) AND (Wojewodztwo" & _
        " = @Original_Wojewodztwo OR @Original_Wojewodztwo IS NULL AND Wojewodztwo IS NUL" & _
        "L); SELECT ID, Imie, Nazwisko, Firma, Adres, Miasto, Wojewodztwo, KodPocztowy, T" & _
        "elefon, Faks, Email, NazwiskoSoundex 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("@NazwiskoSoundex", System.Data.SqlDbType.VarChar, 4, "NazwiskoSoundex"))
        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_NazwiskoSoundex", System.Data.SqlDbType.VarChar, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "NazwiskoSoundex", 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 (NazwiskoSoundex = @Original_Nazwisk" & _
        "oSoundex OR @Original_NazwiskoSoundex IS NULL AND NazwiskoSoundex IS NULL) AND (" & _
        "Telefon = @Original_Telefon OR @Original_Telefon IS NULL AND Telefon IS NULL) AN" & _
        "D (Wojewodztwo = @Original_Wojewodztwo OR @Original_Wojewodztwo IS NULL AND Woje" & _
        "wodztwo 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_NazwiskoSoundex", System.Data.SqlDbType.VarChar, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "NazwiskoSoundex", 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))
        '
        'SqlConnection1
        '
        Me.SqlConnection1.ConnectionString = "workstation id=WER;packet size=4096;integrated security=SSPI;data source=WER;pers" & _
        "ist security info=False;initial catalog=Nowinki"
        '
        '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"), New System.Data.Common.DataColumnMapping("NazwiskoSoundex", "NazwiskoSoundex")})})
        Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
        '
        'DataSet11
        '
        Me.DataSet11.DataSetName = "DataSet1"
        Me.DataSet11.Locale = New System.Globalization.CultureInfo("pl-PL")
        '
        'DataGrid1
        '
        Me.DataGrid1.DataMember = "tblKlienci"
        Me.DataGrid1.DataSource = Me.DataSet11
        Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.DataGrid1.Location = New System.Drawing.Point(16, 8)
        Me.DataGrid1.Name = "DataGrid1"
        Me.DataGrid1.Size = New System.Drawing.Size(584, 232)
        Me.DataGrid1.TabIndex = 0
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(616, 262)
        Me.Controls.Add(Me.DataGrid1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataGrid1, 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
        SqlDataAdapter1.Fill(DataSet11)
    End Sub
End Class
