CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

System.NullReferenceException was unhandled topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2010, 03:31 PM
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
blax00 is on a distinguished road
| More
System.NullReferenceException was unhandled

hello

I'm beginner on c#. I'm getting this error:

System.NullReferenceException was unhandled

and my code:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GittiGidiyor;
using GittiGidiyor.City;

namespace ConsoleApplication1
{ 
    class Program
    {
        static void Main(string[] args)
        {
            CityService cityservice = ServiceProvider.getCityService();
            cityServiceResponse response = cityservice.getCities(1, 3, "", "tr");

          
            if (response != null && response.ackCode.ToString().Equals("success"))
            {
                cityType[] city = response.cities;
                foreach (cityType cities in city)
                {

                    Console.WriteLine("citycode :" + cities.trCode + " / cityname :" + cities.cityName);
                }
            }
            else
            {
                Console.WriteLine("errorid :" + response.error.errorId);
                Console.WriteLine("errorcode :" + response.error.errorCode);
                Console.WriteLine("errormessage :" + response.error.message);
            }
        }              
        }
    }
I've bolded line about getting error
I'll be glad if someone help me
thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
number system sayantani nath C Programming 1 09-02-2010 04:07 AM
unhandled exception of type 'System.Runtime.InteropServices.SEHException' leon22 C++ Programming 0 08-28-2010 02:24 AM
How to Abort a System SHutdown (system sleep) evarmint C# Programming 1 05-31-2010 10:36 PM
Roman no.system to Decimal no. system converting inspiration C Programming 2 04-13-2010 02:11 PM
Database System missthangythang2003 Looking to hire 0 03-08-2007 11:59 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:45 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board