Free database for Entity Framework in WPF MVVM - c#

I want to use a free database to do some databinding (storage) in my WPF Application (PixelSense).
I have already used SQL Server 2010 with Visual Studio 2010 and it works very fine.
I've heard also that Entity Framework does not work great with MySQL due to some incompatibility issues, and SQLite doesn't support Booleans.
What do you suggest for me in this case ?
Edit
Thank you, I've choosed Microsoft SQL Server 2008 R2 Express
Why : Free, by Microsoft, almost the same as SQL Server

In microsoft world, you can use :
Sql Server Express
10Gb per DB size limitation
Sql Local DB, which is the replacement for Sql Server User Instance. It's part of Sql Server Express.
10Gb per DB size limitation
Sql Compact
4Gb per DB size limitation
As it's Microsoft products, you will have less probability of issues.
My preference goes to Sql Compact because of its low binaries footprint. There are however some limitation (ntext not supported very well), at least in the version I used some years ago.
Good to know, Access database are not supported. While Access has not a good reputation, for local app it make senses.
Outside Microsoft World, SqlLite has a good reputation.

Related

Sync oracle database to a kind of local database

I have a central oracle database and I need to write a c# desktop app that can hold all the oracle data for being offline, works on the data and than sync it back to oracle later. The local database should be simple and should not need admin rights to install and use, actually like SQL Compact Edition, which is unfortunately deprecated)
I want to use a modern software architecture, so I thought about using EF 6.0 and generate some entities to work on.
I've read tons of documents and threads, but it seems that almost everything is deprecated. All tutorials I found are made with Visual Studio 2008. Newest version of Microsoft Sync Framework is 2.1 and the additional Microsoft Sync Framework Toolkit was released three years ago with no updates. It also uses Microsoft SQL Compact Edition 4.0, which is deprecated (comment by Microsoft).
I found an example syncing Oracle and SQL CE on code.microsoft.com Database-Sync-Oracle-and-037fb083), but it uses the old and deprecated System.Data.Oracle namespace.
Somethings that's not deprecated is SQL Server 2014 Express and LocalDB, but it needs admin rights to install and hundreds of Megabyte on the disc)
Also SQLite is up to date and can handle this, but unfortunately there seems to be no EF 6.0 support. Here is a nice overview about it
Is there anybody out there who knows some "news" about it?
Finally i used Access with typed datasets. I'm not happy with that. SQLite was the only real option, but there are also no good viewer to see and edit the data. The customer is good with Access, so we used that.
Unfortunately i have two different technologies to use databases in my application. EF for oracle and typed datasets for access... this is poor. nobody knows why microsoft has no modern solution for that, without admin rights and hundreds of megabyte. Also EF can not use Access, whyever. Maybe they want everything in a cloud...

Concurrent access to lightweight/(embedded?) SQL database by several applications on the same local machine?

I am looking for a solution in which several applications on the same machine access one and the same database. Generally the operations are just reads thus I am not interested in having to provide concurrent write access as well.
I checked into SQL Server Express, SQL Server LocalDb, SQL CE, SQLite, MySQL and am not convinced which one is the best solution. I read that SQL CE allows concurrent read access but SQL Server LocalDb does not, which I find very odd given LocalDb is hyped by MS as a version that is very similar in functionality to the SQL Server family and which is supposed to make it easy to later on scale out.
I like to manage 5-10 tables each of which holds less than 5000 rows, so really lightweight content.
I am looking for a solution that meets the following requirements:
Concurrent read access by several applications on the same machine
Should be somewhat lightweight. I intend to move all applications within a solution to a different machine later and do not want to have to install a 200mb full blown SQL Server Ex#ress version if possible.
Should play well with VS2012 express (sqlite and mysql are highly unsupported in that regards, either not supporting EF5 or they do not show up in the server explorer.
Should be an SQL solution in order to manually update database tables within a management console such as Workbench or Management Studio or other third party app.
Should work somewhat with EF or other ORM solution. I want to be able to create an entity class and create a database from that or update tables using class objects. Also I want to populate class object collections from table rows without having to go through SQL code.
I target C# in .Net 4.5 and I guess it boils down to the question whether SQL CE is up to the task to allow concurrent reads and how I can load CE data tables and edit and visualize the content in some sort of management console. Also does SQL CE play well with EF5? Any better suggestions?
Since you're asking for an opinion, SQLite is my answer.
We are aware of no other embedded SQL database engine that supports as
much concurrency as SQLite. SQLite allows multiple processes to have
the database file open at once, and for multiple processes to read the
database at once. When any process wants to write, it must lock the
entire database file for the duration of its update. But that normally
only takes a few milliseconds. Other processes just wait on the writer
to finish then continue about their business. Other embedded SQL
database engines typically only allow a single process to connect to
the database at once.
Entity Framework on SQLite
System.Data.SQLite
Setups for 32-bit Windows (.NET Framework 4.5)
This setup package is capable of installing the design-time components for Visual Studio 2012.
SQL CE Works with EF5 and VS 2012 Express, is very lightweight, supports multiple readers on the same machine, and can be managed in VS Pro+ combined with the SQL Server Compact Toolbox add-in (or standalone) (I am the author)

Switching from using SQL Server Express to SQL Server Compact

So far I have been using SQL Server Express on my desktop application even though usually the server is only used by that single application, by the single user, on the same single machine. This always seemed a bit silly to me since the full-on server is rather heavy.
Then I found out that there is something called SQL Server Compact. Thing is, my application is already rather large. So my question is that if I wanted to change to SQL Server Compact, what kind of changes to my code are we talking about (using C#)?
Mainly I'm wondering if I can access the Compact -version in the same manner as I can access the Express one, which is using ADO.NET and pointing it towards localhost\sqlexpress. So would it be possible to create another instance with the Compact and just point my application to that, or is it used in a completely different manner?
For a standalone desktop product it is certainly a lightweight option to consider over SQL Express.
However there are differences between the two to be aware of other than just connection strings. For example SQL CE does not support stored procedures, user-defined functions, or triggers. Additionally it does not support the full range of datatypes that Express supports. On a technical level it also runs in process with your application.
Another consideration is that while SSMS will work with SQL CE databases, it's not as fully featured as it is with SQL Express. There are however a whole raft of good tools out there for filling these gaps. Take a look at Erik Jensen's blog for a good overview.
Everything SQL Server Compact
Also check out his tool for migrating SQL Express databases to SQL Compact:
How to Migrate/Downsize a SQL Server database to SQL Server Compact 4.0 (and 3.5)
Finally take a look at this SO question for more background between the two products:
What are the limitations to SQL Server Compact? (Or - how does one choose a database to use on MS platforms?)
I worked recently with it, by the way the things I know about using them is that SQL Express has a server to connect to, and, Compact is a sdf file, so the first thing you will have to change is the connection string to it.
After this change, there are no more heavy changes to be done, I remember, compact has almost all the instructions of the express server available, so, it could not be much problem.
Take a look at Microsoft documentation for more information, or at Wikipedia.
See you.
I would vote against SQL CE:
It has no views, which might be an issue when migrating.
We recently did something similar which you described and had tremendous performance impacts when switching from SQL Server Express to SQL Server Compact Edition.
My recommendations would be:
Use SQLite (which we did for the project I mentioned - it was much more performant than SQL CE in our case) -or-
Use VistaDB (which I did in other projects; not as performant as SQL Server Express, but still sufficient)
Both databases can be XCOPY deployed, just like SQL Server Compact Edition.
SQL CE has the same size limitation as Express, so you should be good.
As far as moving between the two, I found this for moving between express databases and compact 3.5 databases. Then I think you'll only have to change your connection strings (instead of pointing at a host/instance, you point at the converted file). There are different features between the two, though, so you might have to change your schema in the original database for the conversion to go smoothly.

Access Database Alternatives

Ok before I explain... I know Access should basically not be used anymore.
My application now uses access for its portability.. its an internal application and makes private/internal database storage a snap.
Problem is, it uses JET 4.0 which is not supported in 64 bit operating systems and is frankly not very well implemented anymore.
I am developing using C# .NET visual studio 2008. I am looking for a way to do this with some other database type that would not require me to install anything else on a users computer. I looked into sqlite but there's no easy way to implement it in visual studio
An Ideas?
You can use SQL Server Compact 3.5 (the embedded version of SQL Server 2008).
I recommend System.Data.Sqlite (http://sqlite.phxsoftware.com/), a managed, open-source ADO.Net wrapper around the open-source Sqlite database. No installation required - you just include the single DLL in your solution. It boasts a small footprint, encryption, and good performance.
SQL Server Express edition should come with Visual Studio. It is an option at installation time, IIRC.
Access has a couple of key characteristics:
- Single-user
- Requires installation
For alternatives this gives you (at least):
SQL Compact (doesn't require installation, single-user)
SQLite (doesn't require installation, single-user--although multi-user is supported)
SQL Express (multi-user, requires install)
SQL CE is a good option as already mentioned. You could also consider xml if the data is not private and you don't have concurrent users (which is very likely if you are using Access). Xpath provides a lot of the features you would normally need from database queries and storage. You also wouldn't need to install anything.
Did you try with H2?
The main features of H2 are:
Very fast, open source, JDBC API
Embedded and server modes; in-memory databases
Browser based Console application
Small footprint: around 1 MB jar file size
Check out about implementation:
http://www.google.ba/search?sourceid=chrome&ie=UTF-8&q=C%23+h2+database
This is one reason why people continue to use Access. Of course you want an easy solution that doesn't require any installs on the client side.
We've all assumed so far your users are disconnected from your SQL Server. If they can connect, you're home free. It's less of a problem if you need to support read-only disconnected use, more of a problem if you need to pull updated data from disconnected users.
Can you tell us more about what you need?
Firebird can be a very good alternative to Access and have very good dot net driver
Here is a comparison between Firebird Embedded and SQL Server Compact Edition
How about XML? Easy to use, and it works on any platform. Not the easies to implement if you're unfamiliar with it, but it's pretty rad once you learn how it works.

Package tsql with application

How can I release a winform application to a user that takes advantage of a local sql database. I would assume that I need to install the database during some kind of setup phase, but is this kind of thing possible? Is there a free version of tsql that can be used in this way? Mysql?
TSQL is a language specification, not an actual database.
If you're talking about MS SQL Server, it is possible to bundle and install an instance of SQL Server Express, if you want to distribute a database with your app. There's some documentation on it over on MSDN, specifically, Embedding SQL Server Express into Custom Applications.
SQL Server Compact Edition is suitable for this. It has some limitations in that it does not support the full set of functionality that SQL Server supports (ie. stored procedures is one example), but it does mean that you don't need an installation of SQL Server to use it. If you are only using the database as a "bit bucket" to store and retrieve data, then it should suffice.
Another alternative is to use SQL Server Express Edition. This does require installing a proper SQL Server instance, but basically gives you a cut down version of the full SQL Server, enabling you to use more of its features.
Both of these are free.
You might also want to check out VistaDB. It is syntactically compatible (although not perfectly) with sql server. All managed code. But it is not free.
SQL Server Compact Edition does not support stored procs, fyi. But is a single file deployment plus your data file.
SQLite is extremely fast and lightweight. Deployment is single file plus data file. But it has some syntactic limitations and has limitations to its dotnet integration (although I am pretty sure there IS a ado.net provider for it.)
I support an application built on sql express edition and it is a PAIN. It has a lot of install failures. (Probably about 10k installs over the last 3 years.) But if you need to power, hot backup, full sp and function support, connection pooling, etc it will work for you.
Never used mysql so I can't comment.
Seth

Categories

Resources