Store persistent data

capri

Active member
Joined
Jun 16, 2015
Messages
42
Programming Experience
5-10
Hi,

I am totally new to ASP.NET. Please help me to create a project to store persistent data.

Thanks
 
If you don't know how to create an ASP.NET app then there are plenty of tutorials around that will help you with the basics. You should do that first.

Once you know how to create a basic ASP.NET app, then we can help you specifically with the persisting data part. Of course, you'd probably need to be a bit more specific about what you actually want to do. Are you talking about the sort of data that you store in a database or application settings or something else? If you don't know then how are we supposed to? If you do know then why make us guess? Be specifc.
 
I don't know where this data should be stored. It is just a list of string data that should be stored somewhere except database. What would be the best method?
 
Well at least we're getting somewhere. You didn't tell us to begin with that it was a list of strings and that you didn't want to use a database. If you specifically want to NOT do something then it's a good idea to tell us, don't you think?

Anyway, if this is a web app and you don't want to use a database then use a file. Such a file should be stored in the App_Data folder. Reading and writing text files is the same in an ASP.NET app as it is in WinForms or any other .NET app.
 
Yes, jmcilhinney, I agree. I should have been more specific.

That's a good start and that's what I wanted. I didn't know how to start with to have a persistent data store in ASP.NET. I will give a try with file system. My first thought is XML file.

Thanks
 
My first thought is XML file.
If it's just to store a simple list of strings then I'd just use a text file. If the data is more complex then XML may be a good option to maintain the structure.
 
So, is it a list of strings or is it something more? If it is something more, which appears to be the case, why did you say otherwise? I'm sure that you're not trying to be misleading and vague and but you're not trying hard enough not to be either. Please remember that we only know what you tell us so please provide accurate and complete information.

Anyway, you can perform CRUD operations on any data stored in any manner. It's just a matter of how you implement the operations. If you're using an XML file then LINQ to XML comes to mind as a first option, although I've never used it.
 
My apologies for any confusion. I did not intend to mislead.

My data is only a list of terms and its meaning or definition. I should add new term, update a term or delete a term if required. A term need not have a definition always. I can leave it blank and should enter it later. This is what I am trying to do. I also would like to see the data in the home page in a simple html table.
 
So you basically want to store key/value pairs. That can be stored as a list of strings where each string contains a delimiter between the key and value or it could be store in XML with the key and value stored in attributes or the key in in an attribute and the value in data.
 
That sounds good. I will store in XML like below.

<Item>
<Id>1</Id>
<Term>test1</Term>
<Description>This is test1</Description>
</Item>
 

Latest posts

Back
Top Bottom