Click here to Skip to main content
15,918,808 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make single instance? Pin
J4amieC1-Dec-09 5:51
J4amieC1-Dec-09 5:51 
GeneralRe: How to make single instance? Pin
Shameel1-Dec-09 6:37
professionalShameel1-Dec-09 6:37 
GeneralRe: How to make single instance? Pin
Shameel1-Dec-09 6:29
professionalShameel1-Dec-09 6:29 
AnswerRe: How to make single instance? Pin
vtchris-peterson1-Dec-09 7:09
vtchris-peterson1-Dec-09 7:09 
GeneralRe: How to make single instance? Pin
RanaSohail1-Dec-09 16:05
RanaSohail1-Dec-09 16:05 
AnswerRe: How to make single instance? Pin
Cracked-Down1-Dec-09 7:23
Cracked-Down1-Dec-09 7:23 
AnswerRe: How to make single instance? Pin
joelwms1-Dec-09 11:17
joelwms1-Dec-09 11:17 
Questionobject reference not set to instance of an object Pin
uglyeyes1-Dec-09 2:07
uglyeyes1-Dec-09 2:07 
Hi!

I am getting this error when I try to assign a value to a class property called country that is in a class called advert

advert class
public class Advert
{
private Country _country;
  public Country Country
        {
            get { return _country; }
            set { _country = value; }
        }
}

country class
public class Country
    {
        private string _CountryName;
        private string _UrlSafeCountryName;
        private string _CountryCode;

        public Country()
        {
            this.CountryName = "";
            this.CountryCode = "";
            this.UrlSafeCountryName = "";
        }
        

        public string CountryName
        {
            get 
            {
                return _CountryName;
            }
            set
            {
                _CountryName = value;
            }
        }
        
        public string UrlSafeCountryName
        {
            get
            {
                return _UrlSafeCountryName;
            }
            set
            {
                _UrlSafeCountryName = value;
            }
        }

        public string CountryCode
        {
            get
            {
                return _CountryCode;
            }
            set
            {
                _CountryCode = value;
            }
        }
    }


in my DAL where i get error
advert.Country.CountryName = (string)oReader["CountryName"];


not sure if i am doing it correctly? please help
AnswerMessage Closed Pin
1-Dec-09 2:09
stancrm1-Dec-09 2:09 
GeneralRe: object reference not set to instance of an object Pin
S. Brozius1-Dec-09 2:16
S. Brozius1-Dec-09 2:16 
AnswerRe: object reference not set to instance of an object Pin
Ravi Sant14-Apr-11 1:52
Ravi Sant14-Apr-11 1:52 
QuestionUse sendkeys() for google chrome Pin
krinaljariwala1-Dec-09 0:44
krinaljariwala1-Dec-09 0:44 
AnswerRe: Use sendkeys() for google chrome Pin
Ashfield1-Dec-09 2:18
Ashfield1-Dec-09 2:18 
QuestionImport old DLL to C# .Net Pin
Reza Shojaee1-Dec-09 0:11
Reza Shojaee1-Dec-09 0:11 
AnswerRe: Import old DLL to C# .Net Pin
Calla1-Dec-09 0:20
Calla1-Dec-09 0:20 
GeneralRe: Import old DLL to C# .Net Pin
Reza Shojaee1-Dec-09 0:26
Reza Shojaee1-Dec-09 0:26 
GeneralRe: Import old DLL to C# .Net Pin
Vimalsoft(Pty) Ltd1-Dec-09 3:48
professionalVimalsoft(Pty) Ltd1-Dec-09 3:48 
GeneralRe: Import old DLL to C# .Net Pin
Dave Kreskowiak1-Dec-09 4:33
mveDave Kreskowiak1-Dec-09 4:33 
AnswerRe: Import old DLL to C# .Net Pin
puromtec11-Dec-09 5:25
puromtec11-Dec-09 5:25 
QuestionCall Stored Procedure Using C# Pin
Phil Saville1-Dec-09 0:07
Phil Saville1-Dec-09 0:07 
AnswerRe: Call Stored Procedure Using C# Pin
Ashfield1-Dec-09 0:16
Ashfield1-Dec-09 0:16 
AnswerRe: Call Stored Procedure Using C# Pin
Vimalsoft(Pty) Ltd1-Dec-09 3:50
professionalVimalsoft(Pty) Ltd1-Dec-09 3:50 
AnswerRe: Call Stored Procedure Using C# Pin
PIEBALDconsult1-Dec-09 4:17
mvePIEBALDconsult1-Dec-09 4:17 
AnswerRe: Call Stored Procedure Using C# Pin
Mark Graham1-Dec-09 5:54
Mark Graham1-Dec-09 5:54 
QuestionWrite DWORD Value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer on Vista Pin
Sunil G 330-Nov-09 23:17
Sunil G 330-Nov-09 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.