473,785 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way to pass a Dataset to a WebService

Hi,
I'm a newbie to the Web Services topic. I have an ASP.NET website and
am trying to send a Dataset from it to a WebService which should insert
all the data from this DataSet to an Access database. Also I'm working
with untyped datasets. I have read some topics in this newsgroup. One
suggested to convert the DataSet to a string using ReadXML, send the
string to the WebService, create a new Dataset and read the string back
into the DataSet.

Can anyone provide me with some sample code for such an approach or a
better one if possible. Below is how I have started my WebMethod that
receives a dataset as a string.

public string updateSpineAsse ssmentData(stri ng datasetXml)
{

string successfullUpda te = "Update Successful";
return successfullUpda te;
}

Quite desperate to finish a project so deligience would be greatly
appreciated.

Thank you and I look forward to your replies

Khurram

Jul 20 '06 #1
2 1427
Just pass the Dataset as a parameter to the web service as you normally
would in any method call.. You don't have to worry about converting it
to a string. The web proxy marshals and demarshals the parameters for
you. The same is true for strongly typed datasets.

Deecrypt wrote:
Hi,
I'm a newbie to the Web Services topic. I have an ASP.NET website and
am trying to send a Dataset from it to a WebService which should insert
all the data from this DataSet to an Access database. Also I'm working
with untyped datasets. I have read some topics in this newsgroup. One
suggested to convert the DataSet to a string using ReadXML, send the
string to the WebService, create a new Dataset and read the string back
into the DataSet.

Can anyone provide me with some sample code for such an approach or a
better one if possible. Below is how I have started my WebMethod that
receives a dataset as a string.

public string updateSpineAsse ssmentData(stri ng datasetXml)
{

string successfullUpda te = "Update Successful";
return successfullUpda te;
}

Quite desperate to finish a project so deligience would be greatly
appreciated.

Thank you and I look forward to your replies

Khurram
Jul 21 '06 #2
Thank you,
I've used that method and it worked perfectly. I have another problem
with .net. Would you happen to know if there are any bugs related to
the DataAdapter.Fil l method in .Net 2 using VS2005.

My issue is that I am communicating information between a website and a
webservice using datasets. The datasets created by filling the
datasets with results of queries using the DataAdapter. My problem is
that for some reason, the fill method seems to miss out on exactly one
row from the database even though that row still conforms to the query
criteria. Below is my code. May be there is something I am
overlooking.
//Assign the type and destination of the database being queried
string source = "Provider = Microsoft.JET.O LEDB.4.0;data source
= C:\\leedsuni\\m scproject\\seco nddemo\\snomede pr.mdb;";

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainas sessmentrecords
WHERE assessment_id = " + assessmentIDTex tBox.Text + "";

//This dataset represents what has just been edited and saved
in the aap database
OleDbDataAdapte r aapDataAdapter = new OleDbDataAdapte r(query,
source);
DataSet aapDataSet = new DataSet();
aapDataAdapter. Fill(aapDataSet ,
"abdominalpaina ssessmentrecord s");

I'm just wondering what would make the adapter miss one row that still
conforms to the query criteria. It just seems like a bug to me.

Thank you kindly

Khurram

Jul 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
520
by: Tal McMahon | last post by:
Hello All, I have an application that uses several layers as such: a Client that references a ClientHelper a ClientHelper references a WebService a WebService that references a Webservice Helper a Webservice Helper that Connects to the SQL server I have been trying to keep my typed datasets on the Webservice helper then passing the datasets as they are
0
1425
by: Tal McMahon | last post by:
Hello All, I have an application that uses several layers as such: a Client that references a ClientHelper a ClientHelper references a WebService a WebService that references a Webservice Helper a Webservice Helper that Connects to the SQL server I have been trying to keep my typed datasets on the Webservice helper then passing the datasets as they are
2
5674
by: Anil Pundhir | last post by:
What is the best way to pass data to a web service. The client(to send data) has .net environment and also the server on which the web service is hosted also has the .net environment. Should I send dataset or an xml which will be created at the client and parsed at the server, in the web service. Which will have a better performance. Thanks,
2
2300
by: Eddie | last post by:
I have a DataSet with relations and other constraints being populated from the backend (SQL Server 2005). I use DataSet.FillSchema to retrieve the table schema for each table in the dataset. I then create the appropriate relations between the tables. I will use a webmethod with a return type of either XmlNode or DataSet to return the data and the schema? Each call to the webmethod will return the data and the schema. Question: ...
0
9480
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,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9947
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
8968
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...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
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
5379
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.