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

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

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
 
What does your operation contract definition look like?
In C#:
[OperationContract]
DataTable GetMembers( )
{
// body here that returns a DataTable
}

Peter
 
Weird.. if I make the type DataSet it returns as such, but not DataTable. I
wonder why it doesn't like DataTables.


Peter Bromberg said:
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 said:
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top