Search
Thursday, November 20, 2008 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

 Print   
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: areel
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 15

People Online People Online:
Visitors Visitors: 0
Members Members: 0
Total Total: 0

Online Now Online Now:

 Print   
 Welcome to blendblog.net! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!


 Print   
 Trick with returning Datables with WCF Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 8/6/2008 6:04 PM

I am using WCF and peer mesh to get "real-time" updates from my server application to my clients.  For one of my operation contracts I wanted to return a typed datatable.  I struggled with this quite a bit and couldn't understand why since a datatable object is inherently serializable.

The problem turned out to be null values in some of the records.  If any of the rows in the datatable contain dbnulls then the receiving side just doesn't receive anything.  Basically WCF malfunctions.  An error is not thrown and when debugging from the sender side everything appears to be sent.  However nothing comes in on the receiving side of things.  This is actually the most frustrating part of WCF, often errors aren't thrown the thing just doesn't work.

Anyway, if you define your tables that you want to pass with WCF to disallow dbnull and provide default values for all the fields you will not have this problem.  That is what I did.  Unfortunately this changes my datatables a bit and I have to make sure that my application isn't check for dbnull to indicate an "unset value" when doing updates etc.  I am guessing that the issue is that dbnull is not serializable which is why it fails.

Hope this is a helpful hint for those struggling with sending datatables with WCF.

Sean

Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

 Print   
 Archive Minimize

 Print   
 Blendblog Survey Minimize
Our next client application will be written using:




Submit Survey  View Results

 Print   
Copyright 2008 by blendblog.net   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by DotNetNuke Corporation