Naruto
Naruto

Reputation: 9634

How to create a simple Local SQL database & insert values into it using C#?

How to create a simple Local SQL database & insert values into it using C#? can any one provide me a sample code or project link.. i googled a bit, i am not getting how to do.. if you can advice it would be great

Upvotes: 7

Views: 21077

Answers (3)

Jaroslav Jandek
Jaroslav Jandek

Reputation: 9563

Sql Server Compact is a great embedded database. It is also fully documented on MSDN, see System.Data.SqlServerCe Namespace.

You can easily create and modify databases programatically, see SqlCeEngine.CreateDatabase Method.

You can download it on the SQL Server Compact Download Page.

Upvotes: 0

Raghu
Raghu

Reputation: 2758

If you are creating a Desktop application, you can create a local Sql server Ce (Compact edition) database.

When you install Visual C# 2008 Express, It will automatically install SQL Compact 3.5 on your box.

Here is an excellent Getting started tutorial on the topic:

http://dotnetperls.com/sqlce

Upvotes: 3

Rodrigo
Rodrigo

Reputation: 61

I would use SQLite. It's simple and it doesn't need any kind of installation, the full database it's only a file.

Upvotes: 2

Related Questions