Gan, ane mau nanya tentang webservice di VB.Net.
Ane punya sistem di PDA, itu kirim parameter bentuknya array ke Webservice (basis VB.Net).
Nah yang ane tanyain itu gimana cara supaya webservice itu bisa nerima parameter ane?
Ni kodenya gan
Spoiler for Webservice:
Quote:
.....
.....
.....
WebMethod() _
Public Function InsertProduk(ByVal key As Array, ByVal val As String, ByVal konter As Integer) As DataSet
Dim conn As String
Dim i As Integer = konter
For a As Integer = 0 To i
conn = "server=localhost;uid=root;pwd=;database=m ile s"
Dim sql As String = "insert into trade set id_pro="' + key(i) + '";
Dim konek As New MySqlConnection(conn)
Dim OdbcDa As New MySqlDataAdapter(Sql, conn)
konek.Open()
Dim ds As New DataSet
OdbcDa.Fill(ds)
konek.Close()
Return ds
Next
End Function
....
....
....
Tapi waktu ane browse service.asmx muncul error gini :
Spoiler for error:
Quote:
Mohon pencerahannya gan
</div>
Ane punya sistem di PDA, itu kirim parameter bentuknya array ke Webservice (basis VB.Net).
Nah yang ane tanyain itu gimana cara supaya webservice itu bisa nerima parameter ane?
Ni kodenya gan
Spoiler for Webservice:
Quote:
.....
.....
.....
WebMethod() _
Public Function InsertProduk(ByVal key As Array, ByVal val As String, ByVal konter As Integer) As DataSet
Dim conn As String
Dim i As Integer = konter
For a As Integer = 0 To i
conn = "server=localhost;uid=root;pwd=;database=m ile s"
Dim sql As String = "insert into trade set id_pro="' + key(i) + '";
Dim konek As New MySqlConnection(conn)
Dim OdbcDa As New MySqlDataAdapter(Sql, conn)
konek.Open()
Dim ds As New DataSet
OdbcDa.Fill(ds)
konek.Close()
Return ds
Next
End Function
....
....
....
Tapi waktu ane browse service.asmx muncul error gini :

Spoiler for error:
Quote:
You must implement a default accessor on System.Array because it inherits from ICollection.
Mohon pencerahannya gan
</div>
![]() |
|
|
Terkait
|
||||
| Thread | Forum | |||
| hosting untuk php webservice tidak berhasil.. | Programming & Web | |||
| Java WebService play! ke spring framework | Programming & Web | |||
| [ask] array di AS3 | Programming & Web | |||
| [ask] php+nusoap as webservice,vb 6.0 as client | Programming & Web | |||




