public static void SetTicketName(SqliteDataReader reader, RoutineTicket ticket) { Type type = reader.GetFieldType(reader.GetOrdinal("ticket_name")); if (type == typeof(int)) { ticket.SetTicketName("" + reader.GetInt32(reader.GetOrdinal("ticket_name"))); } if (type == typeof(string)) { ticket.SetTicketName(reader.GetString(reader.GetOrdinal("ticket_name"))); } }