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="data source=SHEHANS-PROBOOK;initial catalog=HomeLibDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" 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!
you can follow on of this links it might help
1- Answered by santhoshkumar
2- video on youtube
3- codeproject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With