473,516 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning DataTable from Web Service

3 New Member
How to return System.Data.DataTable from XML Web Service. When I run Client I get message:
Cannot implicitly convert type 'MyServer.GetAllRecordsResponseGetAllRecordsResult ' to 'System.Data.DataTable'. I'm using 2.0 Framework
Aug 17 '07 #1
3 2933
nateraaaa
663 Recognized Expert Contributor
How to return System.Data.DataTable from XML Web Service. When I run Client I get message:
Cannot implicitly convert type 'MyServer.GetAllRecordsResponseGetAllRecordsResult ' to 'System.Data.DataTable'. I'm using 2.0 Framework
A web service cannot serialize a DataTable. You will need to return a dataset table instead of a datatable. See this example for more details.

Nathan
Aug 17 '07 #2
f022559ha
3 New Member
A web service cannot serialize a DataTable. You will need to return a dataset table instead of a datatable. See this example for more details.

Nathan
Then why it's defined as
DataTable : MarshalByValueComponent, IListSource,
ISupportInitialize, ISerializable??? Besides that, When I test web service itself, I get table serialized.

Thank you.
Aug 17 '07 #3
f022559ha
3 New Member
Then why it's defined as
DataTable : MarshalByValueComponent, IListSource,
ISupportInitialize, ISerializable??? Besides that, When I test web service itself, I get table serialized. According to msdn articles this is one of the enhancements to ADO.NET 2.0

Thank you.
Aug 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6127
by: K Altsj? | last post by:
If passing a DataSet to a web method for update using ADO.NET and the update fails, the parameter list may get corrupt. The following code example consists of a Web Service and a consumer console application, both written in C# using VS.NET. A tiny MSSQL database is required to run the example: create table test1 (id numeric(1) unique) ...
1
2684
by: bubby | last post by:
Should I be concerned about the classic "Deep/Shallow" copy problem when returning objects, specifically a DataTable or DataView from a method? For example, see the code below: private DataTable LoadStuff() { DataTable dt = new DataTable(); .... dt.Columns.Add(...) ....
2
1154
by: jensen bredal | last post by:
I have a simple webservice that have a webmethod that returns a dataset. How can i use the returned dataset. So far i get an exception. Thanks JB
5
19561
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...
5
4959
by: Jim Murphy | last post by:
In creating a C# web service, I am having trouble returning a DataTable object as the result of a web method. I have no problem returning native types like string or int, but cannot return a .NET DataTable object. The problem occurs when I try to compile the client side C# application (it complains about the DataTable type not being...
0
1762
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: //=================================================================== // The table
4
10203
by: Joseph Geretz | last post by:
I don't get it. A DataTable can't be returned, but a DataSet can. Yet a DataSet contains one or more DataTables. So obviously a DataTable must be serializable. So why not just let me return a DataTable? Thanks for your advice, - Joe Geretz -
15
13483
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...
5
8616
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
0
7182
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...
0
7408
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. ...
0
7581
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...
1
7142
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...
0
5714
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...
0
4773
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
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...

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.