Can someone please help me to connect to a dataset that i have written in a web service? ive tested this on windows on a server and it works fine. Here is my web service vb code that connects to a server.
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function getdataset() As DataSet
' Dim teststr As String
'Dim myconnection As New SqlConnection("add name=OrgStructureConnectionString connectionString=Data Source=infpe006;Initial Catalog=OrgStructure;User ID=Cornenew;Password=corne providerName=System.Data.SqlClient")
Dim myconnection As New SqlConnection("Data Source=infpe006;Initial Catalog=OrgStructure;User ID=Cornenew;Password=corne;")
Dim mycommand As String = ("Select * from OrganizationStructure")
Dim da As New SqlDataAdapter(mycommand, myconnection)
Dim ds As New DataSet
'ds.Tables.Add(dt)
da.Fill(ds, "OrganizationStructure")
da.Fill(ds, "OrganizationStructure")
Return ds
End Function
End Class
what i want to do in android is this:
Dim s As New ServiceReference1.WebService1SoapClient
Dim str As String
Dim ds As New DataSet
ds = s.getdataset()
Dim dt As New DataTable
dt = ds.Tables("OrganizationStructure")
For Each row In dt.Rows
Dim Child As String = row.Item(1).ToString
str &= Child & vbCrLf
Next
MsgBox(str)
End Sub
What this do is getting the dataset from the web service and then i place the dataset in a datatable so i can loop through it. I have no idea how i can do this in android? im very new to this and apologize if there is already an example on b4a but couldnt find anyone with sample code.
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function getdataset() As DataSet
' Dim teststr As String
'Dim myconnection As New SqlConnection("add name=OrgStructureConnectionString connectionString=Data Source=infpe006;Initial Catalog=OrgStructure;User ID=Cornenew;Password=corne providerName=System.Data.SqlClient")
Dim myconnection As New SqlConnection("Data Source=infpe006;Initial Catalog=OrgStructure;User ID=Cornenew;Password=corne;")
Dim mycommand As String = ("Select * from OrganizationStructure")
Dim da As New SqlDataAdapter(mycommand, myconnection)
Dim ds As New DataSet
'ds.Tables.Add(dt)
da.Fill(ds, "OrganizationStructure")
da.Fill(ds, "OrganizationStructure")
Return ds
End Function
End Class
what i want to do in android is this:
Dim s As New ServiceReference1.WebService1SoapClient
Dim str As String
Dim ds As New DataSet
ds = s.getdataset()
Dim dt As New DataTable
dt = ds.Tables("OrganizationStructure")
For Each row In dt.Rows
Dim Child As String = row.Item(1).ToString
str &= Child & vbCrLf
Next
MsgBox(str)
End Sub
What this do is getting the dataset from the web service and then i place the dataset in a datatable so i can loop through it. I have no idea how i can do this in android? im very new to this and apologize if there is already an example on b4a but couldnt find anyone with sample code.