-4

As stated in my question, I want to know if it is possible to connect a C# application with a .mdf file without a Microsoft SQL Server installation.

I found this one.

But it looks a little "old" due the fact that it was created for Visual Studio 2010.

Is there another possibility?

I programmed the Application in C# and I create the initial database with Visual Studio 2013 and Microsoft SQL Server 2014 Express.

What I have tried:

  • Tried the LocalDB (Works but it is still something I have to install on each computer)
Raj More
  • 47,048
  • 33
  • 131
  • 198
Evosoul
  • 197
  • 1
  • 12
  • 2
    That's like expecting asp.net website to run on IIS without installing .NET framework. – Nikhil Vartak Jul 08 '16 at 11:28
  • SQL Server CE is deprecated after VS 2013 http://stackoverflow.com/questions/20363374/is-sql-server-compact-discontinued-from-visual-studio-2013 – Paul Zahra Jul 08 '16 at 11:28
  • Try SQLite https://connect.microsoft.com/VisualStudio/feedback/details/1800520/sqlite-datasource-not-available-in-vs-2015 – Paul Zahra Jul 08 '16 at 11:30
  • @NikhilVartak Can you not read/write XLS files in .NET without having MS Office installed? All you need is drivers. This question should (should?) be treated the same way. – Raj More Jul 08 '16 at 19:46
  • @PaulZahra SQLite did the trick for me. Thanks! If you create an answer I will accept it. – Evosoul Jul 11 '16 at 07:09
  • 1
    May I ask why the question is "On hold"? There are several answers yes, but on nearly all questions there are several answers. A good answer is to long? The comment from "Paul Zahra" is exactly the answer I was searching for, so where is it to long? And how can i improve the question? I don't understand why it is "On Hold". If I am wrong than ok but please explain – Evosoul Jul 11 '16 at 12:53

1 Answers1

3

In brief: NO

.mdf is a SQL Server file, and as such it must have some form of SQL Server (LocalDB, Express, any other edition) installed to be used.

If you need an "embedded" database that can run without any server installation, you need to look at SQL Server CE (Compact Edition) with a .sdf file, or at something totally different like SQLite.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    Or use [VistaDB](http://www.gibraltarsoftware.com/vistadb) (slower but to a large degree compatible with SQL Server features). – Uwe Keim Jul 08 '16 at 11:25
  • By the way... VistaDB is compatible with Visual Studio 2010, 2012, 2013 but not 2015 it seems. – Paul Zahra Jul 08 '16 at 11:33