title: Check if value is string or only integer?
body: <p>I have a list which is being populated from the database. The list is of this format:</p>
  
  <pre><code>class Event
  {
      public int EventID { get; set; }
      public string EventName { get; set; }
      public string EventManager { get; set; }
      public int EventManagerID { get; set; }
      public string EventTicketID { get; set; }
  }
  
  class Manager
  {
      public int ManagerID { get; set; }
      public string ManagerName { get; set; }
      public string ManagerShortName { get; set; }
      public bool IsActive { get; set; }
  }
  </code></pre>
  
  <p>The EventTicketID is usually populated by an integer. But at times, the ticketID also has strings in it. This happens when an Event Manager sub-contracts to another management company in which case the EventTicketId is populated with the format ManagerShortName_TicketID. I want to know check if an event is contracted to an event manager or is contracted to a sub-manager. So I want to check if the EventTickedId is an integer or has strings in it.</p>
  
  <p>I tried checking by using:</p>
  
  <pre><code>//EventList being populated from db in an instance of List&lt;Event&gt; called listEvents
  int directContractTicketID = Convert.ToInt32(listEvent[0].EventTicketID);
  </code></pre>
  
  <p>But I get Unhandled exception. can someone tell me how I can check if if EventTicketId is string or integer?</p>