Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a setup.exe file using InstallShield LE for a Visual Studio 2012 Windows Forms Application with SQL Server 2012 Local Database

I am new in programming and I have created a simple Windows Forms Application using Visual Studio 2012 and combined with a SQL Server 2012 Database. I have used Entity Framework simply to call Stored Procedures as in the below example:

private void initializeCourseComboBox()
    {
        using (HomeLibDBEntities db = new HomeLibDBEntities())
        {
            cmbBxCourse.DataSource = db.uspGetCourseNames();
        }
        cmbBxCourse.SelectedIndex = -1;
    }

My App.config file includes the connection strings as below:

  <connectionStrings>
    <add name="HomeLibWinFormsApp.Properties.Settings.HomeLibDBConnectionString" connectionString="Data Source=SHEHANS-PROBOOK;Initial Catalog=HomeLibDB;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="HomeLibDBEntities" connectionString="metadata=res://*/HomeLibDBModel.csdl|res://*/HomeLibDBModel.ssdl|res://*/HomeLibDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SHEHANS-PROBOOK;initial catalog=HomeLibDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

Note that I have another connection string in above code just because I didn't use Entity Framework entities in my Cristal Reports. Instead I used the normal way of calling SQL Stored Procedures, as in below example code:

ReportDocument repDoc = new ReportDocument();

private void formReaderReport_Load(object sender, EventArgs e)
        {
            repDoc.Load(@"D:\Academic\Training Homework\C#\Projects\HomeLib\HomeLibWinFormsApp\ReadersCrystalReport.rpt");

            SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=HomeLibDB;Integrated Security=True");
            SqlDataAdapter adap = new SqlDataAdapter("uspGetAllReaders", conn);
            adap.SelectCommand.CommandType = CommandType.StoredProcedure;

            DataSet dataSet = new System.Data.DataSet();
            adap.Fill(dataSet, "WholeReader");

            repDoc.SetDataSource(dataSet);
            crystalReportViewer1.ReportSource = repDoc;
        }

Now, I need to publish this application and deploy it in another computer/Laptop. I have already installed InstallShield Limited Edition for Visual Studio 2012 and the thing is, I don't' know how to properly create a setup.exe executable file. I couldn't find any tutorial saying how to do this while having SQL Server database linked with the application. I have tried several things and failed. Please if anyone can help me out with this by suggesting what to do or providing me some exact links to follow, it will be really appreciated. Thanks!

like image 236
ShehanMorawaka Avatar asked Oct 19 '22 11:10

ShehanMorawaka


1 Answers

you can follow on of this links it might help

1- Answered by santhoshkumar

2- video on youtube

3- codeproject

like image 188
Hussein Khalil Avatar answered Nov 01 '22 07:11

Hussein Khalil