Click here to Skip to main content
12,696,493 members (31,196 online)
Rate this:
Please Sign up or sign in to vote.

In the REST services I have created my [DataContract] looks like this :
public class Emp
public Guid Eid {get;set;}
public string Ename{get;set;}
public DateTime CreatedDate{get;set;}


I am retrieving the results from database(SQL) and I am retrieving "Ename" value based on Eid.I wrote SQL query and its working fine.I am returing a list .Now I want to display it as JSON response .However I can view the XML response clearly like this :

and run the application then I am getting error:"[Fiddler] ReadResponse() failed: The server did not return a response for this request."

I guess this is only because browser is not taking default date to be 0001-01-01T00:00:00 in JSON response

How can I make this corrected and get the response when the returned date is 0001-01-01T00:00:00?What are the modifications I have to do in the code(DataContract) ?

Thanks in advance...
Posted 15-Sep-12 2:24am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

refer this link

if date is null then just replace it with blank space

WCF REST Service with JSON[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100