Groups | Blog | Home
all groups > dotnet web services > september 2006 >

dotnet web services : Recovering data out of dataset from client


TiGeR79
9/25/2006 8:07:02 AM
Hello,
I've written a webservice which returns a dataset containing just one table
with two columns. One colum holds a string while te second holds an image
serialized into a byte array.
This dataset is returned to a client application.
Now i'd like to know how i can retrieve the data thats inside of my dataset
? Especially my byte array cause i'd like to restore my picture out of it.
David++
9/29/2006 1:37:01 AM


[quoted text, click to view]

Not too sure about the byte array but you can loop through the DataSet a row
at a time and extract the column data a row at a time until there is no more
rows to process i.e something like -

MyApp.MyService.Service service = new MyApp.MyService.Service();

DataSet ds = new DataSet();

ds = service.GetMyDataSet();

if(ds!= null)
{
foreach(DataRow row in ds.Tables[0].Rows)
{
// fetch the data from the row columns i.e. row[0], row[1]
}
}
AddThis Social Bookmark Button