Can .mdf use as embedded database?

I am new to C# and SQL Server databases, so this may be a stupid question but I am confused.

I want to setup an embedded database on a client machine automatically when he installs my application. I know SQL Server Compact Edition is there but there are so many restrictions in SQL Server CE.

Can I use .mdf files as an embedded database? If yes then how can I setup it on client machine automatically? or is there any other option to solve my problem?


I would recommended to use SQLite. It is simpler to deploy. Also, SQL Server Compact appears to be discontinued.

Is SQL Server Compact discontinued from Visual Studio 2013?

You can use SQLite which doesn't require any installation on the client machine.

SQLite depends on the Visual C++ runtime, but you don't need to install it on the client machine. The download page contains several "static" packages that already contain the runtime.

All the "static" packages contain either native or mixed-mode assembly binaries linked statically to the appropriate version of the Visual C++ runtime. Typically, these packages are used in cases where customer machines may not have the necessary version of the Visual C++ runtime installed and it cannot be installed due to limited privileges.

For example, on my machine I am running Windows 8.1 x64 so I went under Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0) and downloaded

This binary package contains all the binaries for the x64 version of the System.Data.SQLite (3.8.2) package. The Visual C++ 2010 SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is required.

I then unzipped the package and ran test.exe to make sure everything works. Zero installation required.

Need Your Help

using information_schema to find size of innodb databases

mysql innodb information-schema

We have about 60-70 databases on an RDS server, and a lot of them can be deleted.

Fatal Error Call to member function result() - Code Igniter

php codeigniter

Seems like a common occurance this error on here, Looking at the answers I still cant quite work out why I'm getting an error.