Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 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 February 13th, 2012, 06:17 PM
sef sef is offline
Registered User
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chapter 19 Web Services

On page 651 Try it out there's an instruction right at number 1:
Add a new C# Windows Forms Application to the [ASP.NET] solution ...

But how?

Oops i just found out how: Add Item, New Project - C# Windows Form...
Sorry... this form you can fill in alright, but when you press 'Reverse Message' it crashes on its own non-error. This is weird, or i'm missing sth.

Code:
        void client_ReverseStringCompleted(object sender, WebServicesSample.ReverseStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                textBox2.Text = e.Result;
            }
            else
            {
                MessageBox.Show(e.Error.Message);
            }
        }
 
Old February 14th, 2012, 01:20 AM
Friend of Wrox
 
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Default menu

Hi there

if you create a new solution that contains only one project, you can't add new project from Solution Explorer. to do this from 'File' menu point to 'Add Project...' and continue.
__________________
happy every time, happy every where

Reza Baiat
 
Old February 14th, 2012, 09:06 AM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

Quote:
Originally Posted by irProject View Post
Hi there

if you create a new solution that contains only one project, you can't add new project from Solution Explorer. to do this from 'File' menu point to 'Add Project...' and continue.
This depends on your project settings. If you have a C# configuration (Tools -> Import and Export Settings -> Reset all settings), the solution explorer shows the solution, and you can add projects. If you have other settings configured (VB, Web...), with only one project the solution explorer just shows the project.

Hope this helps.
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
The Following User Says Thank You to ChristianNagel For This Useful Post:
irProject (February 14th, 2012)
 
Old February 14th, 2012, 09:11 AM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

Quote:
Originally Posted by sef View Post
On page 651 Try it out there's an instruction right at number 1:
Add a new C# Windows Forms Application to the [ASP.NET] solution ...

But how?

Oops i just found out how: Add Item, New Project - C# Windows Form...
Sorry... this form you can fill in alright, but when you press 'Reverse Message' it crashes on its own non-error. This is weird, or i'm missing sth.

Code:
        void client_ReverseStringCompleted(object sender, WebServicesSample.ReverseStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                textBox2.Text = e.Result;
            }
            else
            {
                MessageBox.Show(e.Error.Message);
            }
        }
You need to change the expression of the if statement:
Code:
  if (e.Error == null)
  {
    textBox2.Text = e.Result;
  }
  else
  {
    MessageBox.Show(e.Error.Message);
  }
In the first Version when there was no error and e.Error is null, the else clause is Happening where the Error property is accessed. Because the Error property is null, there's a NullReferenceException accessing the Message property.
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19 and Web Deploy jMarvin BOOK: Beginning ASP.NET 4 : in C# and VB 2 November 21st, 2011 03:55 AM
Chapter 19: Try It Out Step 4 - ASP Web Site Admin Tool can't connect fprizzo02 BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 3 February 9th, 2010 07:40 PM
Chapter 5 - Web Services Sample mjk12345 BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 2 July 8th, 2008 01:53 PM
Chapter 6 : Web Services and Ajax 2mk BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 February 11th, 2008 04:21 AM





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