Results 1 to 3 of 3

Thread: Samrtphone app data storage

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Location
    North Carolina
    Posts
    114

    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!
    You only have one life, make it worthwhile.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Samrtphone app data storage

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width