I'm looking for a database system to use with c#. I've mostly used SQL for now, but, this is a small applicaiton I'm gonna to create, which:
-Runs at max 1-2hours each day(so I don't want to have a SQL Server running all the time)
-Will be installed on an usb key(only requirement has to be to have .net 4.0 installed), so it has to be nomade.
What can you advise me? I search a little, but I don't how this kind of database are called.
You can look at the embedded version of Firebird
Firebird have more SQL function than SQLLite which also be a good choice but you can more easily to switch to a full version of the server
The embedded version is an amazing variation of the server. It is a
fully featured Firebird server packed in just a few files. It is very
easy to deploy, since there is no need to install the server. It is
ideal for CDROM catalogs, demos or standalone desktop applications.
Here you can check Entity Framework support
Well, i'd use a file-based "portable" database like:
SQLServer Ce 4.0
Sqlite (I used this provider in the past and it works well, but you have quite a bunch of options).
Related
Hi I published my desktop application on visual studio as a clickOnce installation but I seem to have problems with SQL and Entity Framework Exceptions as this is what my software uses in order to display data. Is there any other way to get around this problem ? Here is an image of what happens when the user wants to see the specific data. Mostly the Exceptions range from both SQL and Entity Frameworks. This only happens upon another computer and not mine which the Software was created on.
Any help would be greatly appreciated !
If you wish to deploy your database with the application binaries then you can try SQL Server Compact instead of the full version of the server, which requires the server to be installed on the machine. The msdn link here will help you with the process -
http://msdn.microsoft.com/en-us/library/aa983326(v=vs.110).aspx
and you can download the application from here -
http://www.microsoft.com/en-us/download/details.aspx?id=17876
In short, SQL Server Compact databases files (.sdf) can be deployed along with your application and some binaries and dlls to help it work on the destination. The msdn topic will show you how to do this.
The full documentation and a good starting point is here too -
http://msdn.microsoft.com/en-us/library/aa983321(v=vs.110).aspx
IMPORTANT Entity framework has some limitations when working SQL Compact Databases, make sure you check and see that this won't be a problem for you.
http://technet.microsoft.com/en-us/library/cc835494(v=sql.110).aspx
I have a WebService developed in .NET which connects to an Oracle Database. To do that I use the ODAC which Oracle Provides.
But every time I need to install my application on the Client Machines, I have so much trouble regarding the "Oracle Client", depending on if he already has an Oracle Client installed that is not the same version, or if he has one with a different platform (32bit, 64 bit), or anything else.
The point is I spend too much time trying to fix that thing every time.
Is there a way I can configure my application that I can install it, and it has everything it needs. And I don't need to worry about what the server has installed or what will be installed on it. Is there a way?
ODP.NET is distributable and multiple versions can be installed on one machine. You can include it with your app and that will minimize versioning issues.
It sounds like you are currently using the unmanaged ODP.NET driver. If so, have a look at the XCopy install. You can look at how the scripts work and include them in your own install.
If you can use the Fully Managed ODP.NET that will mostly eliminate the 32-bit vs 64-bit issue (unless you are using distributed transactions). And it is only 10 MB.
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index-101716.html
Maybe you can check out the Oracle Instant Client?
Oracle Instant Client
The Basic download contains all files needed if you're only wanting to connect to the db from your .Net app. I have used this a lot in the past. Simple install, too.
I have spent several days trying to solve this problem with no luck and my requirements are really simple - I want to make an application with database which will work on most PCs (without DB server installed) and I want to use LINQ. For the compatibility reasons I want to use .NET framework 3.5 (every Windows 7 machine has it).
I have tried 2 ways: SQL Server CE and SQLite.
SQL Server CE
Although Visual Studio does not support LINQ for Compact Version of SQL server, I have found simple workaround - generating .dbml file using metal.exe tool from Visual Studio and then dragging it into project. My application works fine on my machine, but when I copy it somewhere else, it crashes. I have copied all dlls from C:\Program Files (x86)\Microsoft SQL Server Compact Edition\3.5 and tried 4.0 too. I think problem is that my app is not looking for dlls (references) inside its directory. I managed to get it work using DataSets (without LINQ), where I manually add reference to SQLServerCE and check CopyLocal to true. BUT when I use LINQ, there is no reference to SQLServerCE in project references and it is working. I don't know how to change it. Or is there a problem somewhere else?
SQLite
After long messing with SQL Server CE, I have tried SQLite. I am very disappointed how poor is SQLite support in .NET. I had to download older version of ADO.NET provider (newer versions does not add SQLite Database into my Visual Studio 2010 - I don't understand why but I googled that it is normal and I have to install old version and then replace it with newer). Then I downloaded dblinq (I have discovered that this project is dead later) and after some messing with dbmetal and dlls I get rid of errors in Visual Studio and compiled my application. But I can't run it, it always crashes on error 40 - like there was no SQLite server. Of course I have copied all dlls. I can't run it even on my development machine.
I am very surprised that it is nearly impossible to create simple database application in C# .NET which will not bother client with servers etc.
Please is there anyone who made SQL CE work with LINQ and mainly who made his app distributable?
I would suggest you try using the nuget Entity Framework for SQL CE package. It will download all the required assemblies to make it work.
http://nuget.org/packages/EntityFramework.SqlServerCompact/
I have an app written in C#. It's a commercial app, written using nothing but free software (Visual C# express and SQL express). So, so far it's all clean.
For the app to work, both the .NET framework and SQL Server Express need to be installed on the clients computer. I already know some of the clients don't have internet connection (for security reasons), so I need to make an installer that would locally (off line) install all the dependencies (.NET framework and SQL Server Express).
So, can I (legally) burn both the .NET framework and SQL Server Express installers on the instalation CD so that the client can just click install and not have to worry about anyting?
I tried contacting Microsoft directly to ask them, but I had no luck.
Well, this Microsoft page will tell you what you needd to redistribute SQL Server Express. And here's a link about redistributing the .NET framework.
Basically, you don't really have any major restrictions when it comes to redistributing either of them. Just dig around the Microsoft website and you'll find everything you'd ever need.
I'm in the process of developing a .NET application that needs to be able to run without a database engine installed on the target machine.
It's predecessor used an mdb file to achieve this. Is there a better alternative now? The database will only have one user in 90% of cases. In the other 10% an standard SQL Server would be used.
The new version of SQL CE looks promising, as blogged by Scott Gu.
There is an ADO.NET Data Provider for SqLite. It provides a fully-functional, single assembly "database engine" that can be deployed with your application, and used without being "installed" on the target machine.
Also...
Advantage Local Server
Is this going to run only on Windows boxes? If so, you have a database engine installed on every machine that is Windows 2000 or later, and that's Jet 4.0 (including DAO 3.6). So, as long as your deployment is limited to Windows and you're not compiling for 64-bit, you can continue using an MDB.