Questo è il mio WebMethod che mi restituisce un Dataset
<WebMethod()> _
Public Function Load(ByVal cb As CommandBuilder) As Data.DataSet
Message = String.Empty
Try
Wait:
If bBusy Then
Threading.Thread.Sleep(MyRnd.Next(1, 1000))
GoTo Wait
Else
bBusy = True
End If
Dim objCmd As New OleDb.OleDbCommand
Dim par() As OleDb.OleDbParameter
intLoaded = 0
For Each item In cb.Items
objCmd.Connection = Conn
objCmd.CommandText = item.SqlString
If Not item.Parameters Is Nothing Then
ReDim par(item.Parameters.Count - 1)
For Each Parameter In item.Parameters
Dim index As Integer = item.Parameters.IndexOf(Parameter)
par(index) = New OleDb.OleDbParameter
With par(index)
.ParameterName = Parameter.Name
.DbType = Parameter.Type
If .DbType = DbType.Decimal Then
Parameter.Value = Replace(Parameter.Value, ",", ".")
Parameter.Value = Replace(Parameter.Value, "€ ", "")
End If
.Value = Parameter.Value
End With
objCmd.Parameters.Add(par(index))
Next
End If
Dim da As New Data.OleDb.OleDbDataAdapter(objCmd)
da.Fill(ds, item.TableName)
da.Dispose()
objCmd.Parameters.Clear()
intLoaded += 1
Next
Catch ex As Exception
Message = ex.Message
Finally
bBusy = False
End Try
Return ds
End Function
Andrebbe spiegato un pò ..... prova a vedere cosa ci capisci e se poi hai bisogno più info ...... fatti sentire
Ciao