Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a Row of Data Through a Web Service

Status
Not open for further replies.
Mar 13, 2005
32
US
Hello,

I am creating a web service and I want it to retrieve and return a row of data. I know I can use a dataset to do this but it’s overly bulky to do so. For example, it takes a quite awhile for a pocket pc to interpret the dataset from the web service. I’m looking for something lighter…

Is there any less bulky way to send a data table or a data column?

Thanks!
 
If you're only returning one row and you want it to be lightweight why not just return a delimited string? You could take this string once it it returned and make your own datatable from it but the actually process of sending/retreiving from the web service should be very quick and small in size.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
In the webservice function,

Code:
Function GetDataRow() as DataRow

Dim dr as New DataDrow

'Do some code to get the DataRow you want.

Return dr

End Function
 
Thanks for the suggestions people.

A delimited string could be a good deal. I didn't realize that you could pass a datarow through a webservice as you cannot pass a datatable through. I tried it, it does work. As a datarow would it still work with non .Net apps?

And ideas on passing a table through without using a dataset?

Thanks again for the help!
 
You can pass any object.
Code:
Function GetTable() as Table

Dim tbl as New Table
Dim row as new TableRow
Dim cell as new TableCell

row.controls.add(cell)
tbl.controls.add(row)

Return tbl

End Function
 
Unfortunately you cannot pass datatables - it gives an error about not being able to serialize the data.

Thanks for the suggestion though.
 
You should be able to pass any object as far as I am aware so it may be a problem with the actual DataTable you are returning.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top