Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList'

value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList'

Scheduled Pinned Locked Moved Windows API
helpquestioncsharpdata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samijf
    wrote on last edited by
    #1

    Please I need help. I am writing a windows application and a web service application using VB.NET 2005. I have a web service method that can return an arraylist object. When I try to type the code that will call the web service method I get the following error message: (value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList') Please any one can help me and tell me how can I return an arraylist from a web service method and how can I consume the web service and be able to receive and convert the arraylist object back to my windows application? Web service Method Code: _ Public Function CustomersList() As ArrayList Dim _Result As New ArrayList Dim oInfo1 As New CustomerInfo oInfo1.CustomerNo = 1 oInfo1.CustomerName = "Customer1" _Result.Add(oInfo1) Dim oInfo2 As New CustomerInfo oInfo2.CustomerNo = 2 oInfo2.CustomerName = "Customer2" _Result.Add(oInfo2) Return _Result End Function The Call to the web service method in the Client side: Private Sub CallWebservice() Dim _Customer As New Customer.Customer _Customer.Url = "http://localhost:1968/Customer.asmx" Dim _Result As ArrayList 1- _Result = CType(_Customer.CustomersList, ArrayList) 2- _Result = _Customer.CustomersList End Sub Thank you.

    L 1 Reply Last reply
    0
    • S samijf

      Please I need help. I am writing a windows application and a web service application using VB.NET 2005. I have a web service method that can return an arraylist object. When I try to type the code that will call the web service method I get the following error message: (value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList') Please any one can help me and tell me how can I return an arraylist from a web service method and how can I consume the web service and be able to receive and convert the arraylist object back to my windows application? Web service Method Code: _ Public Function CustomersList() As ArrayList Dim _Result As New ArrayList Dim oInfo1 As New CustomerInfo oInfo1.CustomerNo = 1 oInfo1.CustomerName = "Customer1" _Result.Add(oInfo1) Dim oInfo2 As New CustomerInfo oInfo2.CustomerNo = 2 oInfo2.CustomerName = "Customer2" _Result.Add(oInfo2) Return _Result End Function The Call to the web service method in the Client side: Private Sub CallWebservice() Dim _Customer As New Customer.Customer _Customer.Url = "http://localhost:1968/Customer.asmx" Dim _Result As ArrayList 1- _Result = CType(_Customer.CustomersList, ArrayList) 2- _Result = _Customer.CustomersList End Sub Thank you.

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      I think you need Vista Home for that to work.

      **

      xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!

      **

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups