473,387 Members | 1,582 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,387 software developers and data experts.

WCF not returning data in DataTable, even though that's what I told it to do

Thanks for reading this.

I've successfully implemented a WCF solution. However, even though I
designate the return type to be DataTable in my class on the server (hosted
under IIS), it comes back as the following in the generated proxy class:

Public Function SelectCountryByID(ByVal guiID As String) As
SelectCountryByIDResponseSelectCountryByIDResult

Now, it doesn't do this when the type is a simple String, but this long
weird thing is what I get for DataTable.

Thanks for any thoughts,
Ron
Mar 19 '07 #1
3 2531
What does your operation contract definition look like?
In C#:
[OperationContract]
DataTable GetMembers( )
{
// body here that returns a DataTable
}

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ronald S. Cook" wrote:
Thanks for reading this.

I've successfully implemented a WCF solution. However, even though I
designate the return type to be DataTable in my class on the server (hosted
under IIS), it comes back as the following in the generated proxy class:

Public Function SelectCountryByID(ByVal guiID As String) As
SelectCountryByIDResponseSelectCountryByIDResult

Now, it doesn't do this when the type is a simple String, but this long
weird thing is what I get for DataTable.

Thanks for any thoughts,
Ron
Mar 19 '07 #2
Weird.. if I make the type DataSet it returns as such, but not DataTable. I
wonder why it doesn't like DataTables.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:60**********************************@microsof t.com...
What does your operation contract definition look like?
In C#:
[OperationContract]
DataTable GetMembers( )
{
// body here that returns a DataTable
}

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ronald S. Cook" wrote:
>Thanks for reading this.

I've successfully implemented a WCF solution. However, even though I
designate the return type to be DataTable in my class on the server
(hosted
under IIS), it comes back as the following in the generated proxy class:

Public Function SelectCountryByID(ByVal guiID As String) As
SelectCountryByIDResponseSelectCountryByIDResul t

Now, it doesn't do this when the type is a simple String, but this long
weird thing is what I get for DataTable.

Thanks for any thoughts,
Ron

Mar 19 '07 #3
Is your datatable a .NET 2.0 version? Only the 2.0 version is serializable, earlier versions are not. The dataset has been serializable all along.
JT

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Apr 3 '07 #4

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

Similar topics

8
by: Buddy | last post by:
Hello, We are using DataTable to store our data that we retrieve from SQL because it provides us with ROW/COLUMN concept. Due to DataTable been memory hungary we are finding that at least 40MB...
3
by: Thirsty Traveler | last post by:
I have a gridview where the datasource is bound after a selection. The result of doing this is that sorting and paging do not work. I was given a sample of how to resolve this, however my attempt...
17
by: I.M. !Knuth | last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until I started goofing around with this: ...
5
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...
0
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: ...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
15
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 ...
5
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
9
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a routine that builds a table using different queries, different SQL Tables, and adding custom fields. It takes a while to run (20 - 45 seconds) so I wrote a thread to handle the table...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.