locked
Better Datatable replacement Object

    Question

  • I know that a lot of question has been asked about datatable object on windows store apps.  But the  only way that I found to replace Datatble is to use collection (ex:observablecollection).   It mean that you must recreate your datatable using a Class and create a List OF() because we don’t have anuy arraylist.  After that you have to make function to Search or Order on your List.  So after a couple of research I found that LINQ does that.  With LINQ your can recreate your table on class and the query is integrate on it.  And I can use Class generated by LINQ to exchange data between WCF and windows store apps.  So this is the problem that I have now:

    In the WCF side I can put DataTable in XML format (ex: datatable.WriteXML) ,  but in the other side what kind of object I can receive that (no datatable on this side).  I don’t study a lot about LinQ (Entity framework) but as I understated this way It like to recreate class that is like you datatable, but the problem is that when you want to add column you have to rebuilt the app and service.

    Do you have some example or “How to” read xml file (like the datatable .XML file)  and put the data on object like datatable on windows store app that it easy to search and order by rows or do you think that LINQ is my best way?

    Thank you

    Wednesday, March 19, 2014 1:51 PM

Answers

  • You might consider passing SQLite table types back and forth over the wire.  I haven't specifically tried this, but SQLite exists for both Store and Desktop apps, so the same types should be available on both ends.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, March 20, 2014 4:19 PM
    Moderator

All replies

  • I think you might be better off just querying the data from the WCF service itself and then update it that was as well.  Is there a reason that you need to download an entire table?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 19, 2014 7:33 PM
    Moderator
  • Yes, I must store data locally (maybe XML files  more than SQLite) because I want to crypte.  The apps must work when is not connected.  In the apps I have to do some search and order and yes I have some big Tables (or part of table to download). For my first apps I just have one table and I don’t need to get information from the user to save.  But in the next apps I will have more than one table and save data from user.  At this time I just want to get data from my table on WCF, store data on file, when the app is open get data from this files, and user can make search on this data.   Is that a simple way to transfert table on windows store apps (ex: List Of ,XDocument with search and order)? 

    Thank you

    Wednesday, March 19, 2014 8:59 PM
  • You might consider passing SQLite table types back and forth over the wire.  I haven't specifically tried this, but SQLite exists for both Store and Desktop apps, so the same types should be available on both ends.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, March 20, 2014 4:19 PM
    Moderator