Is SQL Server Compact Edition Serverless? - c#

Is SQL Server Compact Edition Serverless?
I mean, If I have a Northwind.sdf file in some pc without SQL server installed, can my application still use that?
Is it the same with SQLITE?

Correct.
Both of these databases do not have servers and do not require any installation for end-user.
All you need to do is include the appropriate DLL file

Answer of SLaks + Yes, SQLite is an embedded database too.
SQLite features: SQLite doesn't support RIGHT or OUTER JOIN's, complete ALTER TABLE. See http://www.sqlite.org/omitted.html.

Related

Embedding a database in VS Express 2013

I have found that SQL Server Compact has been discontinued and that SQL Server Express should be used instead. I have been trying to get it working but have failed so far - I need to use it the same way as SQL Server CE - i.e. to insert a local DB into my app so that the DB will be used automatically wherever my app is deployed (no installation of SQL Server etc.). But I just cannot seem to find the way.
Your looking for an embedded database.
http://en.wikipedia.org/wiki/Embedded_database
I would recommened
SQLite and its .net wrapper is here.

C# application using SQL Server database

This might sound a silly question but I've really spend hours in trying to find a solution...
I have a local database on SQL Server and it is used with a C# application.. The only way I view the database is through SQL Server.. It is accessible and altered in my application when I am running the application on my developing PC, but when I run it on another PC the database is not found (obviously) .. How can I include the database sources when I am compiling the program, (so that it would be also found when I run it on other PCs) ?
Initially I used SQL Server CE and I achieved portability, but I had to include stored procedures, and this edition doesn't accept them :/ so I had to turn my attention to the latter type.
Sorry for my terrible English ! :(
Thanks in advance
How can I include the database sources when I am compiling the program, (so that it would be also found when I run it on other PCs) ?
You can't. SQL Server license prohibits distributing parts of it like that, plus there is no documented way to do that. If you need SQL Server on the box, it needs to come from the installer. You can create an installer for your own product, and your installer can install SQL Server if it's needed as a prerequisite.
Alternatively, you could look at other database options such as SQLite for a file-based database. You can distribute the components of SQLite.
If you need a local sql server on each pc where your application runs then you should look into the Express edition of MS SQL Server. It is the free with limitations version of MS SQL Server.

Can share a SQL Compact Edition 3.5 database?

I made an application with SQL Compact Edition 3.5 to be used from many user but in the test I got can't connect to databse after the first one how connected !
this is an erreur in my application or probleme with many connexion in SDF file ?
and what about Compact Edition 3.5 accept 256 connexion!
Depending on how your application behaves, you might be able to replace SQL Compact with SQLite. It can really only handle one write at a time but can handle multiple simultaneous reads. Anything more than that and you should be looking at a real SQL server.
You should look at a Microsoft Locking in SQL Server CE. In a nutshell, it says multi users/application can concurrently access the SDF at the same time provided the database is not locked in a transaction.
Also, I like to mentioned that we also do not have multi user/application access to a SQL Server CE 3.1 file on a network drive. (This constraint may still be true for SQL Server CE 3.5). If you're being affected by this, you will have to ensure your SDF is being opened using a local drive reference.

How to create a simple Local SQL database & insert values into it using C#?

How to create a simple Local SQL database & insert values into it using C#? can any one provide me a sample code or project link.. i googled a bit, i am not getting how to do..
if you can advice it would be great
If you are creating a Desktop application, you can create a local Sql server Ce (Compact edition) database.
When you install Visual C# 2008 Express, It will automatically install SQL Compact 3.5 on your box.
Here is an excellent Getting started tutorial on the topic:
http://dotnetperls.com/sqlce
I would use SQLite. It's simple and it doesn't need any kind of installation, the full database it's only a file.
Sql Server Compact is a great embedded database. It is also fully documented on MSDN, see System.Data.SqlServerCe Namespace.
You can easily create and modify databases programatically, see SqlCeEngine.CreateDatabase Method.
You can download it on the SQL Server Compact Download Page.

Possible way to attach database to exe

I created a small application using C# winforms that uses SQL Server as a database.
Is there a way to attach the database to the exe file so I won't need to install SQL Server on all the machines that I want to run the program on?
As far as I know, that's where SQL Server Compact comes into play.
Quoting the Wikipedia article:
Unlike other editions of Microsoft SQL Server, SQL CE runs in-process with the application which is hosting it; while having a memory footprint of less than 2 MB;
in addition to sql server compact, there is also a c# port of sqlite that you could use.
Have you seen SQL Server Compact?
It's a Zero-config, single file version of SQL Server.
You can use SQL Server compact:
http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
or SQLite:
http://www.sqlite.org/
- it has a .NET library that you can download and use...it's pretty fast and compact
You can included it as part of the app installer. See this article

Categories

Resources