简体   繁体   中英

How to store data in a table locally and present it in C#

I want to setup a table that can:

  1. Save the data on the user's machine
  2. Reference & present the data in the GUI
  3. Capable of adding rows dynamically during runtime

What's the best way to go about this?

DataGridView or TableLayoutPanel or...? I'm having trouble with SQL server CE, as I was going to connect it with the DataGridView, but I'm very new to this kind of work, and wondered if it was even necessary to use SQL.

SQL CE should work OK, but no: you don't have to use SQL. You could just populate a DataSet and save/load that to a file on disk. Or you could use any other serializable object tree and a serializer such as XmlSerializer etc. All of these should work fine with standard bindings like DataGridView . Note, though, that databases get you more granular control over the data. It all depends on whether that is valuable, or if a single flat file will suffice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM