Wrox Programmer Forums
|
BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C#
This is the forum to discuss the Wrox book MCSD Certification Toolkit (Exam 70-483): Programming in C# by Tiberiu Covaci, Rod Stephens, Vincent Varallo, Gerry O'Brien; ISBN: 978-1-118-61209-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2014, 12:38 PM
Registered User
 
Join Date: May 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default WCF Code Not Producing

Hello All,

Chapter 9
pages 400 - 402

Create a Client Application that Uses WCF Data Services: Am I missing something or is the code bad.

Thanks

Code below is not producing any data

NorthwidsEntities db = new NorthwindsEntities (new Uri("http://localhost:????/NorhtwindsService.svc/"));

var categories = from c in db.Categories select c;

foreach (Category category in categories)
{
Debug.WriteLine(string.Format("CategoryID: {0}, CategoryName: {1}",
category.CategoryID, category.CategoryName));
}
 
Old August 21st, 2014, 12:45 PM
Registered User
 
Join Date: May 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Never Mind

The Debug.WriteLine should be Console.WriteLine... (bad code)
 
Old August 21st, 2014, 03:32 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I'm not sure if it was the writer's intent (I didn't write that chapter), but you can use Debug much as you can use Console. By default, they do pretty much the same thing. The difference is Debug statements are removed from release builds.

The Debug class in the System.Diagnostics namespace, so the program should probably include that with a using statement.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Thanks for producing a 3rd edition alanrew BOOK: Professional JavaScript for Web Developers 3rd edition 0 April 12th, 2012 02:21 PM
WCF code Example fcatarino BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8 0 July 21st, 2008 04:38 PM
WCF endpoint error when wrapping WCF service with jdawg1979 Visual Studio 2008 0 July 8th, 2008 11:56 AM
producing XHTML from XSLT holdmykidney XSLT 1 August 24th, 2004 09:00 AM
Report Producing NULL values socoolbrewster Access 2 February 13th, 2004 11:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.