469,898 Members | 1,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Returning strings in web services

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 :)
Nov 16 '05 #1
1 1875
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Randy" <te**@temp.com> wrote in message
news:uu**************@TK2MSFTNGP11.phx.gbl...
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 :)

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by wonderboy | last post: by
6 posts views Thread by karthika.28 | last post: by
2 posts views Thread by Richard Bailey | last post: by
15 posts views Thread by Joseph Geretz | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.