C# Winform Application With MySql as Database Deployement - c#

I am working on C# Winform application (Visual Studio 2010) with MySql as back-end. Meanwhile I am looking for a suitable solution to a problem about How will I deploy this application along with MySql server. As this will be multiuser application, embedded database is not an option. It need to be a server based.
There should be one server, for which this combine deployment is required, for client, ofcourse only application installation is required.
So what are the options do I have for deployment? If I am offering this application available for download from a website, should I break it into 2 separate downloads? One is MySql itself (I am using XAMPP bundle for MySql because it is easy and portable), Second is the application alongwith it's all dependencies. If this approach is followed, then I've to setup whole database required by application from within the application (which I think is not so difficult). But then end user have to download the whole package of MySql, is there anyway I can reduce the size of whole XAMPP package as I am only using MySql database, As I don't use anything else in XAMPP (PHP/Apache/Mercury Mail etc) can I remove them so that size of bundle will be small enough for end user to download?
I've searching long for the solution, and many forums (Including SO) has many questions about it, but there are no helpful solutions. I am looking for better solution from experts of this forum.
Thanks and best regards
Ahmed

Related

detach an SQL server from visual studio

I'm pretty new to developing in Visual studio and working on databases.
I am working on a program that deals with reading and writing data to a database that I created with Visual studio.
I need to work on this project from another computer and copying over the project files was a breeze but I'm facing issues when it came to copying the .mdf database file.
Upon research it seems like, at least in the Microsoft SQL Server program, that I would have to "Detach" the database before copying it over to a different computer. So I am assuming I would have to do something similar with my Visual Studio Database as well.
Anyone has any inputs with regards to this?
If there is not much that I can do, I guess I could recreate all my tables and everything in Microsoft SQL Server program, so that it would be easier to move the database if needed.
I was in a similar situation such as yourself when I began developing my first core application. You have a few different options including:
Detach an already created database from the hosted SQL Server service and "re-attach" to another SQL Server service that is accessible from the desired set of hosts. You have to essentially disconnect the database from the service before you are able to transfer or migrate it since the process will have an exclusive lock on the .mdf file. https://msdn.microsoft.com/en-us/library/ms190794.aspx
Create the necessary .sql scripts to construct the database and run in the appropriate order e.g. create database, create tables, etc. to re-construct the database at the service location.The neat thing about this technique is if you have already created the database (which it sounds like you have) SQL Server allows you to generate scripts rather than having to write them yourself. https://technet.microsoft.com/en-us/library/ms178078(v=sql.105).aspx
Finally you may use a subscription based service such as SQL Server through Azure to host the service for controlled global access aka DBaaS (Database as a Service). I can't post anymore links, but look at Microsoft's Azure SQL Server hosting service if you are curious about this option.
The unfortunate part you have to decide is how much time you would like to invest in this. I began developing the application from scratch which led me to developing scripts to conjure up the database for deployment purposes. Good luck!

Setting up MySQL server on C# deployment

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 :)

How to auto update my application which is developed in c#?

I have developed my application in c# which uses SQL Server Express as a database. I want to update my application through internet. What I want is to update only myapplication.exe
Because in the installed folder there is also application.config where configuration of that server is included such as Server name, Instance name. I do not want to touch this file. It is unique for every machine. Is there any ready mechanism or codes to do that? Please show me directions.
There is the Microsoft solution ClickOnce http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.110).aspx
On the open source side, there is Omaha, from Google, powering Google Chrome, Google Earth etc. http://code.google.com/p/omaha/
Also, take a look at Shimmer, by the folks at Gihub https://github.com/github/Shimmer
Sounds like you need ClickOnce installation.
http://weblogs.asp.net/shahar/archive/2008/01/29/how-to-use-clickonce-to-deploy-your-applications.aspx

Is there any mechanism to secure my .mdf files in SQL Server Express 2008?

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.

Windows Form App - Which database type should I use?

I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx

Categories

Resources