I like to use an database for my program, and I ran into SQLite.
At my first look, SQLite looks great. But there's only one thing.
I don't want that users must install SQLite in order to run the program.
Now did I see that I can download the source code of it.
So my question to you guys is... Can I compile the SQLite server into my program, and then use the server like normal? And when you stop the program, the server stops also??? Is this possible?
Thanks in advance
SQLite doesn't use a server, it's just a DLL reference and a shared file format. It is the best choice for what you are trying to do.
Check this library out: http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki , http://sqlite.phxsoftware.com/
There is no such concept like SqLite server.
For deploying SqLite, to client machine for you it's enough to deploy C# drivers to be able to connect to that DB (you can download them from here), and DB file itself (in case when you don't create it at runtime).
In other words, there is nothing to install, there is no any service to start.
What you are looking for is an "Embedded Database".
SQL Server Express can be embedded, so that your users don't need to install the server. They will just need the data file.
Related
I have a C#.NET application which connects to a MySQL database in a server.
I have a requirement to do some operations offline.( When the client machine does not have internet and cannot access the MySQL database.) My Plan is to create a MySQL database in local machine. Copy all files required to the local database and perform required operations. When the client machine have the access to the MySQL sever copy back the changed files to the server database.
My question is what are the good Options to use as local MySQL. Is there any lighter version of MySQL available?
I also need to install selected MySQL version with the windows installation package generated for my software.
Thanks in Advance.
When I have these situations I usually fall back to SqlLight. Its a simple embeddable database, and if you are using only the simplest insert /select statements you should not need to maintain much difference between your local database access vs the remote database access.
That said. If you are using something that is not that simple it's usually a good advice to bite the bullet and do the whole mySql install thing on the local machine. Because the maintenance of 2 sets of database access will eat up development time like nothing else.
In your case I would use an embedded database with your offline application, something like FireBird where you don't need to install a 3rd party database etc. The FireBird dll's are linked and part of your application deployment. http://www.firebirdsql.org/
I have finished developing the first release of my application which uses MySQL (locally under one license and hosted under another).
Connecting the application to the hosted database works fine, i edit the connection details within my application to the hosted server details and it works fine.
However, when I try and use it locally (server:localhost etc..) i get an error stating it can not access the server. In my application, i have included the mysql DLL files, but I would prefer the user not to have to install MySQL server which is about a 100MB download (i know its quite small these days but want the install to be as pain free as possible).
I know it would be an easy fix just to add this install as a prerequisite, but i am sure there is a way to do it without this, or maybe not. Is there a script i can run which will run through and setup the server with users etc?
Any help is appreciated.
Thanks
Shaun
Connecting to a local mysql database implies there's a mysql database service running and was previously installed.
If you want a database you can distribute with your program without having to install a fully fledged database there are quite a few around such as MSSQLCE.
But otherwise, your user is going to have to install mysql on his own machine and keep it running.
Or you could use SQLLite, which is what i have had the best experience with so far.
It should be easy to refactor your Program to use this, and it takes no user setup to use it.
Hope this helps :)
I have developed C# and SQL Server Express database project. Can I secure from copying and pasting my .mdf file? Is there any way to protect my .mdf file from being watched the schema? So no one could see the functions and tables of my database? No detaching or attaching it to other instances? Do you have any ideas how to do or any ready mechanism?
I used DbDefence in my project. I am satisfied with security now. It has one minus - free version allows only encrypt 77Mb, which is eniugh in my project. If you want to more, you can purchase commercial one. Very easy to install and to use.
You can find more information here http://www.dbdefence.com/index.php
If you need any help, please contact me.
Take a look at my question at: deploy SQL Server Database with a Winforms app.
I ended up using SQL Server CE and I'm perfectly happy with it. No SQL Server installation needed (just a couple of additional dlls). And you can set password for your database as well. If you're using Winforms, there are a couple of glitches. But workarounds for each one can be found with a simple googling.
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.
I have developed a Desktop Application using Visual Studio 2010 in C# and I am using an Access database file (.accdb) as my backend. The application runs smoothly at my end but when I mail it to my client, the application shows errors everytime it tries to write to the database. I have mailed te database file with the application and the Copy to Output Directory property is set to "Copy if Newer". I am sure the issue is a small one and has something to do with the connectivity or the permissioning of the database file. I need some quick help because I am running out of time. Thanx in advance.
What error is the client getting? Maybe s/he doesn't have write permission to their c:\program files directory.
Does your client have MS-Access or the ACCDB drivers correctly installed? Seems to be a driver issue to me. What is the connection string you are using to open the connection to the access database?
You may also try converting your database to MDB instead of ACCDB. MDB is more widely used, and its drivers are usually pre-installed on all Windows machines. Also, this format doesn't need MS-Access to be installed.
Even though this is not obvious by your error messages Input string is not in the correct format and Operation must be an updatable query, they may indicate that you are using reserved keywords as table or column names.
Have a look at this list (MSDN) and check if you have used any of them in your database.