Cómo almacenar localmente datos tabulares [cerrado]

In my .net/c# application on windows desktop i need to locally store some statistics about the users behaviour.

This data should be read again the next time the application is running.

To simply explain the kind of data: it is basically key-value pairs.

I could use something like sqlite but i can imagine there is already something for this premade in .NET?

preguntado el 28 de mayo de 14 a las 12:05

Just use CSV, or something? -

yes, but i was thinking there is maybe something premade so that i dont have to write a CSV parser. -

3 Respuestas

It comes down to what you want to store - for simple data objects you may use XmlSerialization that can be stored into IsolatedStorage area, specific to appdomain, or userlevel.

para más detalles: http://msdn.microsoft.com/en-us/library/cc221360%28v=vs.95%29.aspx

If it is relational then Sqlite is your option as well.

So the million dollar question is - what are you planning to store?

contestado el 28 de mayo de 14 a las 12:05

what i want to store is some simple tabular data. my question is more about the way how to store it. this isolatedstorage, is it only for silverlight? - abrazadera

You can use for desktop apps. I'd used it for Microsoft OUtlook plugins where I want to store data for each user separately. So it gives a great security framework as well. Hope it helps you more: msdn.microsoft.com/en-us/library/cc221360(v=vs.95).aspx - basado en código

i cant seem to find this class in the .net 4.0 framework i am using. - abrazadera

Version Information .NET Framework Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client Profile Supported in: 4, 3.5 SP1 .NET for Windows Phone apps Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1 - basado en código

You can serialize the state using a binary file or even JSON

contestado el 28 de mayo de 14 a las 12:05

my question is more about how to store it not about the format. - abrazadera

My answer as well, you can just create a local file on the machine and persist the data inside. This assumes you're talking about an app that runs locally on the client machine - 3dd

Not sure, what you want to achieve. Just keep the data? Or somehow access/process it? What you do with your data determines the data structure.

Among the others, you could put the items to array or List and access them with LINQ. Or you could use ADO.NET DataSet/DataTable, even without database behind it.

contestado el 28 de mayo de 14 a las 12:05

i already know about the data structure and what to do with it. this question is more about the way of locally storing it. - abrazadera

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.