C# Project - InstallShield , MySql error when run after installation

dpaul1994

I have a project in C# which is created in Visual Studio 2013. I want to create an installer using Install Shield free version. I created an installer and trying to run it on other computer but, when I run it and trying to log into program, I have problems about mysql database. Error message is:

Unhandled exception has occured in you application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Cannot connect.

If I click on details button, I have a serie of errors which refers on Mysql. Example:

System.Exception: Cannot connect ---> MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at simulator.ConnConfig.getConnection()

simulator is the name of the project. ConnConfig is a class where is the connection and getConnection() is a function from ConnConfig which return connection. II tried to install on another computer .NET Framework 4.5.2, SQL Server, but also didn't worked. In my project, I use localhost server where I have a database with 2 tables. My question is, is there any possibility to add that localhost database to installer and use it on another computer? And what redistributables requires this operation? Also, I have installed on computer .NET Framework 4.5, Sql Server 2012..but when I try do add them in InstallShield via Redistributables, but it keeps saying that Needs to be downloaded. Why?

UPDATE

I have this Class where I make the conenction. But I receive error: Additional information: Illegal characters in path. at that line:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SQLite;

namespace simulator
{
    class ConnConfig
    {
        private static string conn = "Data Source=c:\aplicatie.db;Version=3;Password=myPassword;";
        public static SQLiteConnection connect = null;

        private ConnConfig()
        {

        }
        public static SQLiteConnection getConnection()
        {
            SQLiteConnection connect = null;
            try
            {
                connect = new SQLiteConnection(conn);
                connect.Open();// here I receive the error
                return connect;
            }
            catch (SQLiteException e)
            {
                throw new Exception("Cannot connect", e);
            }
        }
    }
}

UPDATE 3

In that class I make the connection to database. In the other forms I just use tables and their data. For connection to program, I use a login form which uses this class to getConnection(). I created that database by adding an ADO.NET in simulator project. And with that, it comes those 2 tables that I already have in localhost server. So, Is ok if I have to create another empty database with new tables, but where to include that code or how to use it, because I don't get how that script works..where should I put it?

carbo18

If your database is going to be installed on each client and your tables are not massive you might want to look at something lighter like SQLite which doesn't need any installation just the dlls and is very fast and efficient and only runs when your program does.

As for for the Needs to be Downloaded issue, it seems you have not setup your prerequisite correctly, you an correct this by following the steps in this article Adding InstallShield Prerequisites, Merge Modules, and Objects to Basic MSI and InstallScript MSI Projects

You might want to look into determining if MySQL is the right solution for you.

SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems

And to see the limitations of SQLite SQLite

Because honestly seems like overkill to install MySQL on every system. If you had one server with MySQL on the network, okay. But on every system seems like a bad idea.

As far as connecting to an SQLite database here is a List of Connection Strings for SQLite

See this topic on how to create Databases and tables Create SQLite Database and table

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

MSI Error 1500: InstallShield Premium Cannot Run Secondary Embedded Installation EXE

From Dev

Android application crash when run after installation

From Dev

Stop InstallShield installation when Inno Setup is detected

From Dev

Android studio error After run the project

From Dev

InstallShield giving ISEXP : error : -5008 when building setup project in VS 2012

From Dev

InstallShield Internal Error 2769 - Error 1001 during installation

From Dev

InstallShield Internal Error 2769 - Error 1001 during installation

From Dev

Run the executable file as administrator in Installshield MSI project using LaunchAppAndWait

From Dev

Permission denied when 'mongod' command is run after successful installation

From Dev

Permission denied when 'mongod' command is run after successful installation

From Dev

Run scripts after installation

From Dev

InstallShield LE error: This installation package is not supported by this processor type

From Dev

Run application after silent install using command line in Installshield

From Java

Error run current project after flutter upgrade v3.13

From Dev

Building InstallShield LE project with MSBuild - Error MSB4062

From Dev

Checking installation integrity with installshield

From Dev

Android - Getting error when i run project in android studio

From Dev

Error Twig when I try to run Symfony 3 project on server

From Dev

Error when building C++ project

From Dev

sparklyr - error after installation

From Dev

Installshield Adding project files

From Dev

Stylecop for InstallShield project

From Dev

Unix permissions error when working with symbolic link and MySQL installation

From Dev

Upgrading project installshield 2008 to installshield 2013

From Dev

OctoberCMS installation MYSQL error

From Dev

New MySQL Installation on pfSense returns 'Bad -c option' when started

From Dev

"undefined reference" error after adding function to a C project

From Dev

Symfony 2.8.1 error after installation

From Dev

error after installation of netbeans 7.3.1

Related Related

  1. 1

    MSI Error 1500: InstallShield Premium Cannot Run Secondary Embedded Installation EXE

  2. 2

    Android application crash when run after installation

  3. 3

    Stop InstallShield installation when Inno Setup is detected

  4. 4

    Android studio error After run the project

  5. 5

    InstallShield giving ISEXP : error : -5008 when building setup project in VS 2012

  6. 6

    InstallShield Internal Error 2769 - Error 1001 during installation

  7. 7

    InstallShield Internal Error 2769 - Error 1001 during installation

  8. 8

    Run the executable file as administrator in Installshield MSI project using LaunchAppAndWait

  9. 9

    Permission denied when 'mongod' command is run after successful installation

  10. 10

    Permission denied when 'mongod' command is run after successful installation

  11. 11

    Run scripts after installation

  12. 12

    InstallShield LE error: This installation package is not supported by this processor type

  13. 13

    Run application after silent install using command line in Installshield

  14. 14

    Error run current project after flutter upgrade v3.13

  15. 15

    Building InstallShield LE project with MSBuild - Error MSB4062

  16. 16

    Checking installation integrity with installshield

  17. 17

    Android - Getting error when i run project in android studio

  18. 18

    Error Twig when I try to run Symfony 3 project on server

  19. 19

    Error when building C++ project

  20. 20

    sparklyr - error after installation

  21. 21

    Installshield Adding project files

  22. 22

    Stylecop for InstallShield project

  23. 23

    Unix permissions error when working with symbolic link and MySQL installation

  24. 24

    Upgrading project installshield 2008 to installshield 2013

  25. 25

    OctoberCMS installation MYSQL error

  26. 26

    New MySQL Installation on pfSense returns 'Bad -c option' when started

  27. 27

    "undefined reference" error after adding function to a C project

  28. 28

    Symfony 2.8.1 error after installation

  29. 29

    error after installation of netbeans 7.3.1

HotTag

Archive