1

I have a project I need to do in C#, in this project I have to create a database which can add rows automatically, perform queries, and present the data from the DB in a table.

Does anybody have any idea how can I do that easily? (what kind of DB to use, or a guids that can guide me during the programming).

Because I google it, but I didn't find anythig.
thanks!

Chuck Conway
  • 16,287
  • 11
  • 58
  • 101
menachem
  • 225
  • 3
  • 8
  • 11
  • 1
    You need to be more specific. What have you googled? Why don't you like sqlite or mssql express??? – Christian Payne Nov 25 '09 at 11:35
  • "How to create a data-driven C# application step-by-step" is impossible to answer adequately. A simple Google query yields : https://learn.microsoft.com/en-us/visualstudio/data-tools/create-a-simple-data-application-by-using-adonet?view=vs-2019 – maxbeaudoin Mar 12 '20 at 18:56

6 Answers6

3

SQLite is a good server-less database: http://www.sqlite.org/. Furthermore, Visual Studio offers the option to install MSSQL server express, or you can download it for free: http://www.microsoft.com/express/sql/default.aspx

For programming guides, look at MSDN, and in the case of SQLite at their site.

Webleeuw
  • 7,222
  • 33
  • 34
  • Thanks, but I prefer a DB that is already built-in in visual studio 2008. Do you have any ideas for that? – menachem Nov 25 '09 at 11:24
  • 1
    SQL Server Express is the closest you are going to get to built in database. There isn't any database built into Visual Studio. – Chuck Conway Nov 25 '09 at 11:27
  • 1
    What about simply using the SQLite version from here, http://sqlite.phxsoftware.com/, which will install Visual Studio support? You need to specify more about the requirements, ie. is installing a separate database server that is always running allowed? – Lasse V. Karlsen Nov 25 '09 at 11:28
3

Is this supposed to be a multiuserapp or just run on a single computer?

  1. multiuserapp: you must install a proper database engine, a good freeware choice is MySQL
  2. single computer, small amounts of data: A good choice would be Sql Compact, included in the .net framework. See this SO Link
  3. simgle computer, much data: I would suggest Microsoft SQL Express, which is possible to embed in the installation with the application. Bear in mind it has a 4 gb limit, MySQL could also be considered for this scenario.

You also would need to run commands like "Create table" and such for creating the table structure etc. It's hard to explain properly without knowing your experience in these matters.

I would suggest you google the mentioned database engines, and ask more spesific questions when you have made up your mind on which engine to use.

Community
  • 1
  • 1
sindre j
  • 4,404
  • 5
  • 31
  • 32
1

You can use SQL Server or MySQL(Free) as a database engine for your project.

Here is a good article to build database in sqlserver http://www.devarticles.com/c/a/SQL-Server/Building-Your-First-SQL-Server-2000-Database/

If you are a student, You can try these tools for free. https://www.dreamspark.com/default.aspx

Vaibhav Jain
  • 33,887
  • 46
  • 110
  • 163
0

For start try using express edition of MsSQL. It nicely integrates with the visual studio and lot of work is wizard driven.

From your application side, System.Data.SqlClient namespace would provide you APIs where you can interact with the database.

For creating database, you can use the management studio of MsSQL which is more graphic to perform options. The other option is you do it programmatically within you application. this would complicate your application and makes it difficult to change queries at some later stage.

Beginning C# 2005 Databases by Karli Watson is good book which uses express edition of both MsSQL and VC# to demonstate what you are trying to do.

K Singh
  • 1,710
  • 1
  • 17
  • 32
0

Either Microsoft Access or sqlite is good enough for your purpose

Graviton
  • 81,782
  • 146
  • 424
  • 602
0

Usually projects as the one you mention in your question intend to teach you basic concepts in data processing, sorting, hashing and searching. If you use Sqlite3, it will save you a lot of work, but maybe the point is not to use any shortcuts, since you project is an educational one (if my guess is right...).

My advice is to build your own database engine. I found this article which shows how to do that. I tried to code and it works however It's not generic enough but can be used for educational purposes.

Michael Haephrati
  • 3,660
  • 1
  • 33
  • 56