private void cmbPCNo_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { string PCName = cmbPCNo.SelectedValue as string; txtUserTicket.Text = objTimeManagementManager.GetTicketNoManager(PCName, DateTime.Today); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "PC Name", MessageBoxButton.OK, MessageBoxImage.Error); } }
Work smarter, not harder.