c# object reference not set to an instance of an application

Discussion in 'Software' started by mastermosley, Jan 10, 2010.

  1. mastermosley

    mastermosley Sergeant

    I'm trying to populate data from an xml database but I keep getting an error. My form_load calls loadplayer.

    Code:
           private void LoadPlayerData()
            {
                try
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(xmlloc);
                    XmlNode node = null;
                   
                    
                    node = doc.SelectSingleNode("//player[@name='" + comboBox1.Text + "']");
                 catch(Exeption ex)
                 {
                          MessageBox.Show(ex.message);
                 }
    
    This is throwing the error "object reference not set to an instance of an application". I can't go: XmlNode node = new XmlNode(); so I dont no how to get around this.
     
  2. mastermosley

    mastermosley Sergeant

    Ya problem solved, I had the wrong xml file loading haha
     
  3. Kodo

    Kodo SNATCHSQUATCH

  4. mastermosley

    mastermosley Sergeant

    Thanks, I was looking for something like that.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds