|
-
November 17th, 2009, 10:56 AM
#1
Casting Issue
Hi,
I am trying to call a web service and return the results in an ArrayList. I'm petty much at a standstill with a casting issue. Here is the function that call the webservice and the error.
Using Windows CE
Thanks!
public ArrayList GetTicketsForOffline() { WebService.TicketVO wsTicket = new WebService.TicketVO(); WebService.TicketService service = new WebService.TicketService(); ArrayList arrTicketResult = new ArrayList(); ArrayList arrTickets = new ArrayList(service.GetTicketsForOffline().ToList()); for (int i = 0; i <= (arrTickets.Count - 1); i++) { TicketVO ticket = new TicketVO(); wsTicket = (WebService.TicketVO)arrTickets[i];<--System.InvalidCastException: InvalidCastException ticket.EventID = wsTicket.EventID; ticket.IPAddress = wsTicket.IPAddress; ticket.OrderID = wsTicket.OrderID; ticket.SaleDate = wsTicket.SaleDate; ticket.ScanDate = wsTicket.ScanDate; ticket.StatusID = wsTicket.StatusID; ticket.TicketID = wsTicket.TicketID; ticket.TypeID = wsTicket.TypeID; arrTicketResult.Add(ticket); } return arrTicketResult; }
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|