0

I ran into a stupid problem.

I started developing a Windows Forms application in C# that must be stand-alone (work with absolutely no installation) and needs a database. Being genius that I am I didn't read too much into it and used SQL Server Express .MDF database.

Now it works perfectly, with Linq and all it's perks (data context, designer and so on) but what I didn't know is that client machine will need SQL Server installed to work with database. My program will be potentially deployed to 200-250 PCs and installing SQL Server on all of those PCs is not an option.

Is there any way to use a SQL Server CE database instead of .MDF? Or will I have to rewrite half the program?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

First, read about SQL LocalDB. It still requires installation and requires administrator rights for installation. However it supports silent installs, installer size is only 33MB, and it supports the majority of the features of the full-blown SQL.

If you cannot afford any installs at all, then yes, SQL CE might be an option for you. Whether you’ll need to rewrite half the program depends on how exactly you use your database. If you rely on stored procedures, views, raw SQL, other advanced features then yes, you might need to rewrite half of your program. If you only use linq2sql with simple queries, then you might be fine and only need to rewrite the DB initialization code. Remember the last visual studio that supports SQL CE tools is 2012.

If you can’t install anything at all, and you will be rewriting half of your app — remember there’re many embedded databases now days.

You could instead prefer SQLite: it’s cross platform, extremely popular, SQL language.

Or ESENT: there’s no SQL but it has tables/schema/indices/transactions, part of Windows wince win2k, the performance is really good, 10-100k requests/seconds is normal.

Community
  • 1
  • 1
Soonts
  • 20,079
  • 9
  • 57
  • 130