473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 updateSpineAssessmentData(string datasetXml)
{

string successfullUpdate = "Update Successful";
return successfullUpdate;
}

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 1405
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 updateSpineAssessmentData(string datasetXml)
{

string successfullUpdate = "Update Successful";
return successfullUpdate;
}

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.Fill 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.OLEDB.4.0;data source
= C:\\leedsuni\\mscproject\\seconddemo\\snomedepr.md b;";

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainassessmentrecords
WHERE assessment_id = " + assessmentIDTextBox.Text + "";

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

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
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...
0
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...
2
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.