Returning strings in web services

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Hello,
I have a web service in which I'm doing a query to an Access database and
returning the resulting XML data when I do the return from the service...
public string AOS_Data(string sql)
{
CDFDBSoapService.DBWebService dbws = new CDFDBSoapService.DBWebService();
Do the connection stuff here...
return dbws.queryDatabase(sql);
}

This all works fine. I was thinking about doing the query and returning the
results into a string and then returning that string like...
public string AOS_Data(string sql)
{
CDFDBSoapService.DBWebService dbws = new CDFDBSoapService.DBWebService();
Do the connection stuff here...
string buffer = dbws.queryDatabase(sql);
return buffer;
}

I'm not sure what the length of buffer (above) would be so I'm not sure if
all the data would get returned. When you do a...
string buffer = dbws.queryDatabase(sql);
Does this make buffer as long as it needs to be to handle the returning data
in the query, or is there a finite length?
Thanks all...

Cheers :)
 
Randy,

If you return a string, you can be assured that the complete string will
be returned.

Also, if you want to return a DataSet (since you seem to be going
against a database), you can do that, and the web service will wire it up
correctly for you.

Hope this helps.
 
Back
Top