473,698 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)
{
CDFDBSoapServic e.DBWebService dbws = new CDFDBSoapServic e.DBWebService( );
Do the connection stuff here...
return dbws.queryDatab ase(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)
{
CDFDBSoapServic e.DBWebService dbws = new CDFDBSoapServic e.DBWebService( );
Do the connection stuff here...
string buffer = dbws.queryDatab ase(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.queryDatab ase(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 2080
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.co m

"Randy" <te**@temp.co m> wrote in message
news:uu******** ******@TK2MSFTN GP11.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)
{
CDFDBSoapServic e.DBWebService dbws = new CDFDBSoapServic e.DBWebService( ); Do the connection stuff here...
return dbws.queryDatab ase(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)
{
CDFDBSoapServic e.DBWebService dbws = new CDFDBSoapServic e.DBWebService( ); Do the connection stuff here...
string buffer = dbws.queryDatab ase(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.queryDatab ase(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2312
by: wonderboy | last post by:
Hey guys, I have a simple question. Suppose we have the following functions:- //-----My code starts here char* f1(char* s) { char* temp="Hi"; return temp;
6
430
by: karthika.28 | last post by:
Hi, I am writing a function that needs to return an array of strings and I am having some trouble getting it right. Can you help me answer the following questions? 1. How does the function return the array? 2. How should the function be declared? 3. How is the return value captured by the calling program?
2
1275
by: Richard Bailey | last post by:
Hi. I've got a problem that is totally baffling me. Its also a very simple one. Basically the following code : <WebMethod()> _ Public Function HelloWorld() As String Return "Hello" & Chr(13) & Chr(10) & "World" End Function Returns "HelloWorld" when I display it in a textbox or output it to a file with StreamWriter. I'm creating an application that takes files
5
2677
by: Rob | last post by:
Hi, I have defined an enumeration thus: Public Enum CollectionDayOfWeek NoCollectionDay = -1 Sunday = DayOfWeek.Sunday Monday = DayOfWeek.Monday Tuesday = DayOfWeek.Tuesday Wednesday = DayOfWeek.Wednesday
8
2343
by: Myron Marston | last post by:
For a WebService I am developing, I return a DataSet that contains a table listing Field Names and Field Values. The FieldValue column is given the type object becuase it can potentially contain any of the primative value types (date, int, decimal, string, bool, etc). However, when my client consumes the webservice, it is always a string, even if the value wasn't a string when it was put into the dataset. How do I return different types...
5
19593
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return an Array instead of an ArrayList. Now I get the message when I try to run just my webservice...
1
5550
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two other properties... bool error; string lastError; My whole class looks like this... using System;
9
7887
by: Paul | last post by:
Hi, I feel I'm going around circles on this one and would appreciate some other points of view. From a design / encapsulation point of view, what's the best practise for returning a private List<as a property. Consider the example below, the class "ListTest" contains a private "List<>" called "strings" - it also provides a public method to add to that list,
15
13508
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data between application tiers. In fact, there are whole books written on the subject.
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8855
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.