简体   繁体   中英

C# Database Options

I am working on learning c# better and have never stored data before. I am writing an application that will grab information from the web and I need to store it so the application can use it again at a later time. I am familiar with mysql, like its feature set, but feel that having the end user install an sql server might be a little much. Im not to the point of learning the xml aspects associated with c#. If possible, I am looking for a file based sql type solution as that would minimize the learning curve in that area leaving me room to focus on the language, however I am open to any suggestions. Google has helped a bit but it doesn't know c# as well as you guys do.

Edit: I'm expecting up to 1k records in 4 different tables.

There are lots of options you can look at - depending on how much information you want to store and how you plan on accessing it.

You can always read/write to a file.

There's also a concept of 'configuration' settings. It ultimately reads/writes to a file, for you. Key/value pairs can be very simple to write, but you can also define custom configurations.

You can also serialize objects (and persist them to a file). This is different than reading and writing 'stuff' to a file, in that the Framework will reconstruct the original object and it's state.

You can also use something like SQL Lite. It allows you to interact with a 'database' but it doesn't require an database install. It's essentially a database in a file.

Of course - you can always host the SQL server yourself and provide access (directly or through a webservice or some other means).

Having said all that, I'm sure I've missed a bunch.

What's 'best' is really going to depend on your requirements. I see now you are expecting 'four tables' - so it sounds like you've got a relational database in mind. I'd recommend looking at SQL lite.

SQL Express is too big for 1k and 4 tables.

You should use either SQLite or SQL CE.

I'd just use SQL Server Express . SQL Server is fairly standard and easy to learn so it makes sense for a beginner.

You can opt SQL Server 2012 Express (free edition) so you can learn how to access data from database.

On top of that use Entity Framework to maximize your learning curve for C# and Database Interactions.

A Good video is here .

A must read beginner's guide is also provide.

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