tags:

views:

190

answers:

5

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!

+3  A: 

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
Thanks, but I prefer a DB that is already built-in in visual studio 2008. Do you have any ideas for that?
menachem
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
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
+3  A: 

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.

sindre j
A: 

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.

Kavitesh Singh
+1  A: 

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
A: 

Either Microsoft Access or sqlite is good enough for your purpose

Ngu Soon Hui