Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2007

Tip: Looking for answers? Try searching our database.

wcf and returning a datatable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dave - 19 Nov 2007 20:51 GMT
i have a working wcf service and am having problems returning a datatable
from the wcf service.
I am able to return properties and collections of objects however when
returning a datatable i am getting a returned type of
'CheckListResponseCheckListResult' (where checklist is the name of the
function that returns the datatable)

testing code below
       Dim stmp As WF374WCF.CheckListResponseCheckListResult =
svc.CheckList(97)
           Console.WriteLine(stmp.Any)

stmp.any is an xmlelement (which appears to have the schema information but
i have yet to find the data (rows) within the return object.

How do i get the datatable rehydrated on the client site?

thank you
dave
Tiago Halm - 06 Dec 2007 23:37 GMT
A datatable is serialized via .NET Serialization, and you're building a
WebService where the standard serialization (optimized for SOAP
interoperability scenarios) is used. The standard serialization applies to
simple types or complex types decorated with DataContract attribute.
DataTable is not a simple type.

The datatable serialization is not universal, is only .NET specific. You
would be better off creating a DataContract with the expected struct the
DataTable contains and return a List<MyStruct>.

Tiago Halm

>i have a working wcf service and am having problems returning a datatable
> from the wcf service.
[quoted text clipped - 16 lines]
> thank you
> dave

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.