Click here to Skip to main content
14,365,158 members
   

Mobile

 
Questionmaps Pin
junnubabu.N13-Dec-13 17:18
memberjunnubabu.N13-Dec-13 17:18 
AnswerRe: maps Pin
Tom Marvolo Riddle30-Dec-13 3:24
professionalTom Marvolo Riddle30-Dec-13 3:24 
QuestionPush notifications to IsolatedStore Pin
Alex C. Duma10-Dec-13 21:29
memberAlex C. Duma10-Dec-13 21:29 
QuestionCopying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd9-Nov-13 0:10
professionalVimalsoft(Pty) Ltd9-Nov-13 0:10 
SuggestionRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Richard MacCutchan9-Nov-13 0:41
protectorRichard MacCutchan9-Nov-13 0:41 
GeneralRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd9-Nov-13 0:45
professionalVimalsoft(Pty) Ltd9-Nov-13 0:45 
QuestionHow to Download the a Video,Audio, PDF, etc into a Local Storage Pin
Vimalsoft(Pty) Ltd8-Nov-13 21:55
professionalVimalsoft(Pty) Ltd8-Nov-13 21:55 
QuestionXML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 7:49
professionalVimalsoft(Pty) Ltd8-Nov-13 7:49 
Good Day All

i am trying to load an XML into a Model in WindowsPhone , so no DataTables , i tried the following last resort but it gives a Generic error that is not clear. The Following is the XML



<SONGS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SONG>
    <SONG_ID>1</SONG_ID>
    <TITLE>SONG1</TITLE>
    <PRICE>3.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
  <SONG>
    <SONG_ID>2</SONG_ID>
    <TITLE>SONG2</TITLE>
    <PRICE>3.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
  <SONG>
    <SONG_ID>3</SONG_ID>
    <TITLE>SONG3</TITLE>
    <PRICE>R4.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
  <SONG>
    <SONG_ID>4</SONG_ID>
    <TITLE>SONG4</TITLE>
    <PRICE>3.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
  <SONG>
    <SONG_ID>1</SONG_ID>
    <TITLE>SONG5</TITLE>
    <PRICE>6.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
  <SONG>
    <SONG_ID>5</SONG_ID>
    <TITLE>SONG6</TITLE>
    <PRICE>10.95</PRICE>
    <URI>http://media.lakewood.org.edgesuite.net/JOM/podcast/mp3_audio/596_Podcast.mp3</URI>
  </SONG>
</SONGS>



and my model is defined like this

public class SongsModel
  {
      public int SONG_ID { get; set; }
      public string TITLE { get; set; }
      public string URI { get; set; }
      public string PRICE { get; set; }
  }

and the Function is

<pre lang="c#">
public static List<songsmodel> GetSongs()
{

//Get the XML and Convert it to DataSet
XDocument loaded = XDocument.Load("MUSIC.XML");
List<songsmodel> songs = (from c in loaded.Descendants("SONGS")
select new SongsModel()
{
SONG_ID = (int)c.Element("SONG_ID"),
TITLE = (string)c.Element("TITLE"),
URI = (string)c.Element("URI"),
PRICE = (string)c.Element("PRICE")
}).ToList<songsmodel>();
return songs;
}
and i get the following Error , a Generic Windows Phone Exception

An unhandled exception of type 'System.ArgumentNullException' occurred in System.Windows.ni.dll


Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com

AnswerRe: XML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 8:23
professionalVimalsoft(Pty) Ltd8-Nov-13 8:23 
QuestionAjax Navigation in Windows Phone 8 Pin
santhosh_init6-Nov-13 22:10
membersanthosh_init6-Nov-13 22:10 
AnswerRe: Ajax Navigation in Windows Phone 8 Pin
Hadrich Mohamed31-Dec-13 10:15
professionalHadrich Mohamed31-Dec-13 10:15 
Questioneclipse Pin
Member 103849266-Nov-13 13:38
memberMember 103849266-Nov-13 13:38 
AnswerRe: eclipse Pin
Richard MacCutchan7-Nov-13 0:02
protectorRichard MacCutchan7-Nov-13 0:02 
QuestionLooking for cross platform development/framework feedback Pin
Joe Woodbury30-Oct-13 6:53
professionalJoe Woodbury30-Oct-13 6:53 
AnswerRe: Looking for cross platform development/framework feedback Pin
Jeremy Hutchinson30-Oct-13 8:05
professionalJeremy Hutchinson30-Oct-13 8:05 
AnswerRe: Looking for cross platform development/framework feedback Pin
A_WoodApple30-Oct-13 9:39
memberA_WoodApple30-Oct-13 9:39 
GeneralRe: Looking for cross platform development/framework feedback Pin
Joe Woodbury1-Nov-13 7:50
professionalJoe Woodbury1-Nov-13 7:50 
GeneralRe: Looking for cross platform development/framework feedback Pin
Member 1047558618-Dec-13 15:02
memberMember 1047558618-Dec-13 15:02 
AnswerRe: Looking for cross platform development/framework feedback Pin
dexterama30-Oct-13 9:41
professionaldexterama30-Oct-13 9:41 
GeneralRe: Looking for cross platform development/framework feedback Pin
Joe Woodbury1-Nov-13 7:32
professionalJoe Woodbury1-Nov-13 7:32 
AnswerRe: Looking for cross platform development/framework feedback Pin
Kent Sharkey30-Oct-13 12:01
staffKent Sharkey30-Oct-13 12:01 
GeneralRe: Looking for cross platform development/framework feedback Pin
Joe Woodbury1-Nov-13 7:54
professionalJoe Woodbury1-Nov-13 7:54 
GeneralRe: Looking for cross platform development/framework feedback Pin
Kent Sharkey1-Nov-13 8:28
staffKent Sharkey1-Nov-13 8:28 
AnswerRe: Looking for cross platform development/framework feedback Pin
docdal3-Jan-17 0:09
memberdocdal3-Jan-17 0:09 
QuestionGPS Coordinate system Pin
i gr825-Oct-13 4:46
memberi gr825-Oct-13 4:46 

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.