How to Run C# application that uses MySQL on another PC? - c#

I know this subject was discussed here before, but it looks like there are several opinions.
My C# App is connected to a Database using MySQL, I created an installer for it and tried to run it on another PC.
The program didn't work.
How can I make it run on others PCs?
How to include the MySQL Database with my installation package?
If I used the localDatabase in visual Studio 2013 instead of MySQL will this solve my issue and make the application run on other PCs?
When I use the localDatabase; a (*.mdf) file is copied to the debug folder, if I just included this file in the installation package, will it be enough?

Related

How to install MySQL server on client system with my software setup, in C#?

I have create a Windows application in WPF using Visual Studio 2013, and I'm using MySQL as database, now I want to include MySQL as a distributable package in my setup file.
I am new to development and have very little idea about deploying the software, and i have been searching over the internet but hardly finds any good article which explains the steps to perform the task.
A MySQL database is supposed to be setup on a (remote) database server that the client applications connect to. You don't (or at least you shouldn't) set up a server on each workstation where your client application is installed on.
What you probably want is a self-contained database that can be shipped with your application and run "as-is" without any remote servers or specific setup.
SQLite is a popular example of such a database.
Getting started with SQLite in C#: http://blog.tigrangasparian.com/2012/02/09/getting-started-with-sqlite-in-c-part-one/
Use this:
https://marketplace.visualstudio.com/items?itemName=UnniRavindranathan-MSFT.MicrosoftVisualStudio2013InstallerProjects
And then follow this:
http://geekswithblogs.net/TarunArora/archive/2014/04/24/visual-studio-2013-installer-projects-ndash-hello-world-installer.aspx
There will be settings which you will be setting when creating installer with the wizard, one will be like pre-requisites for the program and will ask you for a MSI location for that program. Dump the location of your LocalDB or whatever MySQL software that you are using (Popular ones are SQLite/SQL Server Express). When the user starts to install the program it will make them install your SQL prerequisite software before moving onto installing your program.

How to create .exe with C# winforms Application & MSSQL Database in Advanced Installer Architect

I'm facing severe issue while creating .exe file of my C# WinForms Application using Advanced Installer Architect. I'm not getting to know how exactly to create an exe file with MSSQL Database.
Kindly help me solve the issues:
I want MSSQL Database to be installed automatically on the system if it doesn't exist.
I want to know what should be the datasource in my application while building it.
I also want the tables should be created automatically t the now installed MSSQL Server Database.
Kindly help me with this issue!
If you are using Visual Studio then you already have exe created.
visual studio is much smarter. and its creating exe every time we run our win form application.
you can find exe in your projectfolder/bin/debug/yourexe.exe

Using sqlite database in c# project and create setup

I am trying to use Sqlite database in my C# project and I done this well in IDE. My problem is when I make setup package for my project and I install it, the program can't access to the sqlite database. Also I know it is because the user doesn't have permission to access file, and when I run program as administrator the problem is solved.
My questions is, how can I use sqlite database in my project so that the program to be executed without administrator permission after installation?
I am using Installshield Limited Edition to deploy my project.
I think that if you wrap the database in an installer, it will extract to Program Files, in which you might have problems accessing for write access with certain users.
InstallShield should have a special pseudo folder to pop the datafile in AppData. You'll also need to change your program so that it expects to find the database there.
I can't quite remember the details I'm afraid.
Mark

.Net Application Installation 2012 with database

I have built a Windows Forms application using Visual Studio 2012 and MSSQL 2008. I need to deploy this project using InstallShield Limited Edition.
While running this application on my pc, it does nto work well when I use the following connection string or .//SQLEXPRESS.
I need the installer to find the exe file of the application on other uer's pc with the database file. Where do I need to put my database files in the deployment files folder? What should my connection string be?
i use .//SQLEXPRESS it doesnt work as well
DO NOT use .//SQLEXPRESS as datasource name in the connection string.
Recommended way is to menthion Instance Name if your application is to be deployed in different environments(especially OS). I ran into trouble when I had the Datasource as .dot which worked in Win 7 not in WinXP. Either one of the following approach works fine.
(local)\SqlInstanceName
(ComputerName)\SqlInstanceName Ex: CD-SJHONES\SQLINSTNACE
In certain cases i had to include the computer name, So during the application deployment i get the computer name and update the connection string accordingly.
where i need to put my database files in deployment files and folder
and what should be my connection string
Connection string
I have already answered connection string releated question above.
Database files
What do you mean by database file. how database is created in the client machine ? do you create a database during application deployment or users manually create it with script ? There is nothing to worry about the database fine as long as your application have right connection string to point to your database.
Application files and folders
Again this doesn't really matter where application files and folders resides in the client machine. It's upto the users to decide where he/she likes to install the application.
You cannot install from backup. Also in your scenario, you should force end user t install Sql Express, what If it has already installed. So You need considering , scripting of entire database. You can create another exe / look for option in Installshield to execute that Script incase the database server is found else, force user to download the Sql Sever Express or Embedd it into setup and execute the script over there. But that will make your Setup Size more than 100's of MB.

Including a stand-alone copy of a Database inside Published VS2010 C# Project

I have designed a small C# Windows Forms project in VS2010 & now want to Publish it and test it on another PC. I seem to recall seeing an option when I was first setting the Database up, that if I set that option on, a complete stand-alone copy of the SQL Server database would be included in the published project, so that even a PC without SQL Server of any kind installed, would be able to run the program ... but I can't remember where I saw it or, obviously now, how to choose that option !!!
Can somebody please tell me where I saw this and how to set this option on ?
UPDATE ...
OK, I think I've found out what to do here, as when I installed it onto the other PC it automatically downloaded and installed SQL Server 2008, I changed options in the Solution Explorer Properties / Publish / Prerequisites ...
If you have simple needs for a local DB you could use SQLServer Compact Edition. SQL CE runs in process within your app.

Categories

Resources