|
-
Mar 15th, 2004, 02:40 AM
#1
Thread Starter
New Member
sending ArrayList as parameter to function in VB.Net using Webservices
I am using webservices in my project.
I have a function in my class taking ArrayList as argument. The webservices function has the same signature.
And when I am sending the arrayList as param to that function from my form, I am getting the following build error:
"Value of type 'System.Collections.ArrayList' cannot be converted to '1-dimensional array of System.Object".
My code is as Follows:
Function in Class:
Public Function ModifyPayment(ByVal ModifyParams As ArrayList) As Integer
objParam = objCommand.Parameters.Add("@t51_RowID", SqlDbType.Int)
objParam.Direction = ParameterDirection.Input
objParam.Value = ModifyParams(0)
//similar statements accessing arraylist items.
End Function
Function in WebService:
<WebMethod()> _
Public Function Payments_ModifyPayment(ByVal ModifyParams As ArrayList) As Integer
Dim Payments_DataObjPatDL As PatientPoint_DataLayer.DataClassPat.DataObjPat
Try
Payments_DataObjPatDL = New PatientPoint_DataLayer.DataClassPat.DataObjPat
Payments_ModifyPayment = Payments_DataObjPatDL.ModifyPayment(ModifyParams)
Return Payments_ModifyPayment
Catch ex As Exception
'write some exception methodology
Finally
Payments_DataObjPatDL = Nothing
End Try
End Function
Calling the function from the front end form:
Dim MohanWs As PP_ClaimsWS.PP_ClaimsWS
MohanWs = New PP_ClaimsWS.PP_ClaimsWS
ModifyPmtParam.AddfrmNew.PmtBl.ModTicketTransId) ModifyPmtParam.Add(Me.txtModAmt.Text) ModifyPmtParam.Add(Me.txtModNotes.Text) ModifyPmtParam.Add("Kumar") ModifyPmtParam.Add(Me.Text)
If (MohanWs.Payments_ModifyPayment(ModifyPmtParam) = 0) Then 'getting the build error in this statement
MsgBox("Modified Amount Successfully")
end if
Please clarify where I am going wrong.
Thanks and Regards
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
|