DataSet Question

I would like to return a dataset with a couple data-tables out of a webservice and then use it in a client application. How would I return the structure out of the webservice and then consume it in the client windows app?
LVL 5
thenrichAsked:
Who is Participating?
 
käµfm³d 👽Commented:
You would need to create a function on the web service that returned a DataTable/DataSet. Your client application would have a reference to your web service and thus it would know that the function is returning a DataTable/DataSet and you would capture it as a return value from the function and use it as you would any other code. My syntax might be off a little as I started wrting this in C# ;)
// Your webservice
 
<OperationContract()> _
Function GetData(string parameter) As System.Data.DataTable
 
 
// Your client
 
Dim webVar As new WebServiceName
Dim dt As System.Data.DataTable
 
dt = webVar.GetData("some parameter value")
 
Console.WriteLine(dt.Rows(0)(0).ToString())

Open in new window

0
 
thenrichAuthor Commented:
I was missing setting my funaction on the web service as a dataset
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.