I'm new in C# I have some experience with JAVA. In java I could use Derby or sqlite for local database without the need of installing additional services on the client computer. Is there a way to do this in c#? Note that I use VS2012 Express.
Asked
Active
Viewed 193 times
0
-
3Use SQL Server Compact Edition. This should be the default for new projects in VS2012. – millimoose Feb 14 '13 at 12:19
-
You could check a question of mine relative to SqlExpress `LocalDB` and why I have chosen to not use Sql Server Compact Edition vs LocalDB http://stackoverflow.com/questions/9655362/localdb-deployment-on-client-pc – Steve Feb 14 '13 at 12:23
-
Also if you're a student at most schools you can get a licence for the "real" VS through [Dreamspark](https://www.dreamspark.com/). – millimoose Feb 14 '13 at 12:23
-
@Steve Also a good option but arguably not the recommended way if all you need is a data persistence backend for a desktop app. LocalDB seems more like a way to more easily develop apps that will, in production, target a "real" SQL Server instance. Also it seems to me that it still requires *some* installation on the target computer (instead of just bundling a DLL), just a less complex one than a full SQL Server instance. – millimoose Feb 14 '13 at 12:25
2 Answers
1
Yes. you can use local databases (*.sdf files). So you need this dll.
System.Data.SqlServerCe.dll

Hossein Narimani Rad
- 31,361
- 18
- 86
- 116
-
How come data type, like int can only be 4 in lenght?!?! I can't change that in table editor.. – CatWithGlasses Feb 14 '13 at 13:01
1
You can use SQL compact database, all you have to do is add a new item in your project and set the item to be a database file. It will create a default SQL compact DB for you with everything preset.
P.S SQL compact should be installed with your VS2012

Faaiz Khan
- 332
- 1
- 4