ASP.NET How to convert array objects converted to string back to the array
Hey I have the following function,
Dim results() As Object = Me.Invoke("webdirect", New Object() {Company, LocationCode, CustomerNumber, OrderNumber, OrderRef, OrderDate, WebLines})
o_Company = CType(results(1),System.Nullable(Of Integer))
o_LocationCode = CType(results(2),String)
o_CustomerNumber = CType(results(3),String)
o_OrderNumber = CType(results(4),String)
o_OrderStatus = CType(results(5),String)
o_OrdDescrip = CType(results(6),String)
RespLines = CType(results(7),webdirect_RespLinesRow())
Return CType(results(0),String)
So the return type of this function is a string, but I would like to get it back to its original form so I can access the individual sections i.e. o_LocationCode,o_CustomerNumber, etc how can I do that ?
Further Edit
Entire functions looks like this
Public Function webdirect(<System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByVal Company As System.Nullable(Of Integer), <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByVal LocationCode As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByVal CustomerNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByVal OrderNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByVal OrderRef As String, <System.Xml.Serialization.XmlElementAttribute(DataType:="date", IsNullable:=true)> ByVal OrderDate As System.Nullable(Of Date), <System.Xml.Serialization.XmlArrayAttribute(IsNullable:=true), System.Xml.Serialization.XmlArrayItemAttribute("WebLinesRow", IsNullable:=false)> ByVal WebLines() As webdirect_WebLinesRow, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef o_Company As System.Nullable(Of Integer), <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)&g开发者_JAVA百科t; ByRef o_LocationCode As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef o_CustomerNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef o_OrderNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef o_OrderStatus As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef o_OrdDescrip As String, <System.Xml.Serialization.XmlArrayAttribute(IsNullable:=true), System.Xml.Serialization.XmlArrayItemAttribute("RespLinesRow", IsNullable:=false)> ByRef RespLines() As webdirect_RespLinesRow) As <System.Xml.Serialization.XmlElementAttribute("result", IsNullable:=true)> String
Dim results() As Object = Me.Invoke("webdirect", New Object() {Company, LocationCode, CustomerNumber, OrderNumber, OrderRef, OrderDate, WebLines})
o_Company = CType(results(1),System.Nullable(Of Integer))
o_LocationCode = CType(results(2),String)
o_CustomerNumber = CType(results(3),String)
o_OrderNumber = CType(results(4),String)
o_OrderStatus = CType(results(5),String)
o_OrdDescrip = CType(results(6),String)
RespLines = CType(results(7),webdirect_RespLinesRow())
Return CType(results(0),String)
End Function
Called like this
Dim returnArray As String
returnArray = client.webdirect(10, "123", "123", "123", "147", "2011-11-1", webLinesArray, 10, "", "", "", "", "", webRespArray)
No errors on run time but the string seems to be just blank, thats why i was wondering how I convert the string back to the array so I can access the individual elements.
Can you just return the array?
Return results
精彩评论