Samrtphone app data storage
I am working on a very simple Smartphone app. I want to store 3 little application settings. I can't figure this mess out. I have beat my head against the wall trying the sample at the following link http://msdn.microsoft.com/en-us/library/ms839369.aspx
IT DOESN'T WORK!
I keep coming up with a NULLReferenceError on the following that is BOLD (xmlApplicationData) : (this is straight from the sample)
Code:
public class ApplicationData
{
private const string xsdApplicationData = @"\Storage\Program Files\ISBNAnyplace\ApplicationData.xsd";
private const string xmlApplicationData = @"\Storage\Program Files\ISBNAnyplace\ISDNAnyplace.xml";
public DataSet GetAll()
{
// Iniate new dataset
DataSet ds = new DataSet();
// Read schema and xml
ds.ReadXmlSchema(xsdApplicationData);
// Return the dataset regardless if ReadXml throws an exception or not
// There is no dataset the first time the application runs
try
{
ds.ReadXml(xmlApplicationData);
}
catch {}
// Return dataset
return ds;
}
if anyone knows a better way please let me know where i can find some samples. This is the last piece ... well except for deployment. Come on how hard could that be!:bigyello:
Re: Samrtphone app data storage
Hey,
Have you tried stepping through your code in the debugger? What you have described would indicate that the XML File isn't there. Which would sort of make sense as I do not think you have constructed the path correctly.
Gary
P.S. I have asked for your thread to be moved to the Mobile Development Forum
Re: Samrtphone app data storage