private void txt_Vehicle_TextChanged(object sender, TextChangedEventArgs e) { connect = new CTUConnection();// refreshens the 'CTUConnection' class // try { if (Department == 1) { connect.SelectInvoiceNewVehicle(); //*Selects the specified columns in the Patient table*// connect.SearchInvoiceVehicle(txt_Vehicle.Text); //Searches the customer's 'name' within the populated table// DGV_Invoice.ItemsSource = connect.dataset; //*All the selected fields are filtered inside the table and stored inside the grid-view*// } else if (Department == 2) { connect.SelectInvoiceOldVehicle(); //*Selects the specified columns in the Patient table*// connect.SearchInvoiceVehicle(txt_Vehicle.Text); //Searches the customer's 'name' within the populated table// DGV_Invoice.ItemsSource = connect.dataset; //*All the selected fields are filtered inside the table and stored inside the grid-view*// } } catch (Exception) { } }