private void ClickDeleteClient(object sender, RoutedEventArgs e) { try { DataRowView rowView = TableClient.SelectedValue as DataRowView; string rowName = rowView[0].ToString(); string rowFamile = rowView[1].ToString(); string rowSurname = rowView[2].ToString(); string rowMSPasport = rowView[3].ToString(); string SQLDelete = $"DELETE FROM Clients WHERE Name = N'{rowName}' or Surname = N'{rowFamile}' or Otchestvo = N'{rowSurname}' or MsPassport = N'{rowMSPasport}'"; Bd.Delete(connectionString, SQLDelete); TableClient.ItemsSource = Bd.InitializeGrid(connectionString, QueryClient).DefaultView; TableInsurance.ItemsSource = Bd.InitializeGrid(connectionString, QueryContarct).DefaultView; } catch { MessageBox.Show("Не выбрана запись", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } }