473,468 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

make setup with SQL database in installshield

18 New Member
Hello
i want make a setup for C# program with SQL data base
but i can not . i use installshield but i have error in connection to database in
execution program.
please tell me about step of make setup in installshield
Apr 20 '13 #1

✓ answered by vijay6

Hey imanjan, first load your project in Visual Studio, go to Solution Explorer window, Right your project -> Add -> New Item -> Serive-based database then add. You can find the connection string in app.config file. While making the installer attach this database file along with your application (so there is no need to install SQL Server in customer machines).

33 13174
vijay6
158 New Member
Hey imanjan, you want to connect your application with a local SQL database?
Apr 20 '13 #2
imanjan
18 New Member
yes
in setup i must install sql express for Customer system (i have sql 2008R2 database)and then i need a sql login for username & password
but i can not Implementation it in my setup
Apr 20 '13 #3
vijay6
158 New Member
Hey imanjan, do you want to install whole SQL Server 2008 R2 in every client machine?
Apr 21 '13 #4
imanjan
18 New Member
no
i want install some thing that can execute my program.
Apr 21 '13 #5
vijay6
158 New Member
i want install some thing that can execute my program.
Hey imanjan, What's your need?
Apr 21 '13 #6
imanjan
18 New Member
i want make a setup for C# program with SQL data base
but i can not . i use installshield but i have error in connection to database in
execution program.
please tell me about step of make setup in installshield whit sql connection
Apr 21 '13 #7
vijay6
158 New Member
i use installshield
Hey imanjan, did you tried an installer project in Visual Studio?

i have error in connection to database in execution program.
Can you share your connection string?
Apr 22 '13 #8
imanjan
18 New Member
yes
at first I tried make install project with VS installer. but in this way I had SQL express and my App in Customer system but I could not connect my App to SQL.
after that I used installshield for made install project but also I have that problem.so I want correct steps for make install project in installshield.

and excuse me where are you from ?
Apr 22 '13 #9
vijay6
158 New Member
I had SQL express and my App in Customer system but I could not connect my App to SQL.
Hey imanjan, so SQL Server database and Your C# application aren't in same machine?

where are you from ?
Why you're asking?
Apr 22 '13 #10
imanjan
18 New Member
Hey imanjan, so SQL Server database and Your C# application aren't in same machine?

\\\\\\\\\\\\\\\\\\\\\\
we have one machine for install package that contain SQL and my App
\\\\\\\\\\\\\\\\\\\\\
Expand|Select|Wrap|Line Numbers
  1. Why you're asking?
maybe we talk better
Apr 23 '13 #11
vijay6
158 New Member
we have one machine for install package that contain SQL and my App
Hey imanjan, so you want to run your application in the same machine where SQL Server was installed or from the different machine(s) or both?
Apr 23 '13 #12
imanjan
18 New Member
run application in the same machine where SQL Server was installed.
Apr 23 '13 #13
vijay6
158 New Member
Hey imanjan, is your program working (successfully connecting your database) before creating an installer using InstallShield?

Did you used your connection string with the following format?

Expand|Select|Wrap|Line Numbers
  1. SqlConnection con = new SqlConnection("Server=YourServerName\YourInstanceName; Database=YourDataBase; User Id=YourUsername;
  2. Password=YourPassword;");

Still if you've error means next time post the error message...
Apr 24 '13 #14
imanjan
18 New Member
Hey imanjan, is your program working (successfully connecting your database) before creating an installer using InstallShield?

yes it work correctly

/////////////
Did you used your connection string with the following format?

yes I used it

//////////////////
when I install my insstalshield package in Customer machine(contain SQL Express & my App) and then execute it, I have This error
error message :

unhandeled exception has occurred in your application

A transport-level error has occurred when sending the request to the server.
(provider : TCP provider,error:0 - An existing connection was
forcibly closed by the remote host).
Apr 24 '13 #15
vijay6
158 New Member
when I install my insstalshield package in Customer machine(contain SQL Express & my App) and then execute it, I have This error error message :
Hey imanjan, its because the connection string which you wrote inside your program was to connect your SQL Server Database not your customer machine's SQL Server Database. If you run your program in other machine means you have to specify that machine's connection string in your program like as follows.

Expand|Select|Wrap|Line Numbers
  1. SqlConnection con = new SqlConnection("Server=Your_Customer_Machine_ServerName\Your_Customer_Machine_InstanceName; Database=Your_Customer_Machine_DataBaseName; User Id=Your_Customer_Machine_Username;
  2. Password=Your_Customer_Machine_Password;");
Apr 24 '13 #16
imanjan
18 New Member
yes I understand .
and thank for your attention.
but I do not Know how to create a setup that can work in all
machines
Apr 24 '13 #17
vijay6
158 New Member
I do not Know how to create a setup that can work in all
machines
Hey imanjan, you're developing an application with installer in your computer but you want to run that application in other computers which will connect the SQL Server database in that computer?
Apr 25 '13 #18
imanjan
18 New Member
yes .
that is right .
Apr 25 '13 #19
vijay6
158 New Member
Hey imanjan, one way is use local database. Another way is don't store your connection string details (Server name, Database name, User ID, Password) inside your program because it may different from one computer to another computer. Instead of this store Server name, Database name, User ID and Password it in your application settings. And use it in your connection string.
Apr 25 '13 #20
imanjan
18 New Member
Another way is don't store your connection string details (Server name, Database name, User ID, Password) inside your program because it may different from one computer to another computer. Instead of this store Server name, Database name, User ID and Password it in your application settings. And use it in your connection string.

//////////////////////////////
I do this for my C# program and change connection string whit XML file that copy to customer machine with my App.

but I install SQL Express with my App. and it has not any login
and I don't Know How to create new login(with my username & password) and attach my database to SQL express

and other Question :
How find server name of customer machine ?
Apr 26 '13 #21
vijay6
158 New Member
How find server name of customer machine ?

Hey imanjan, you get server name (by default SQL Server name will be his/her computer name) by using the following code...

Expand|Select|Wrap|Line Numbers
  1. System.Net.Dns.GetHostName();

You chose which option?
Apr 26 '13 #22
imanjan
18 New Member
You chose which option?

for what ?
Apr 26 '13 #23
vijay6
158 New Member
You chose which option?

for what ?

Hey imanjan, for database connection... i.e., Local SQL database or SQL database.
Apr 26 '13 #24
imanjan
18 New Member
I make my Data base in SQL.
what is the Local Data base ?
Apr 26 '13 #25
vijay6
158 New Member
Hey imanjan, if you choose database in SQL Server means then you need to install SQL Server in all customer system but if you choose Local database then there is no need to install SQL Server in all customer systems. You can create that local database inside your Visual Studio and attach database to your application then send that database along with your application to your customers.
Apr 26 '13 #26
imanjan
18 New Member
so how I must create that local database inside my Visual Studio and attach database to my application ?
Apr 26 '13 #27
vijay6
158 New Member
so how I must create that local database inside my Visual Studio and attach database to my application ?
Hey imanjan, its your wish.
Apr 26 '13 #28
imanjan
18 New Member
I must make a database in SERVER Explorer in Visual Studio and then make new connection there for my username & password

is it true ?
Apr 26 '13 #29
vijay6
158 New Member
Hey imanjan, first load your project in Visual Studio, go to Solution Explorer window, Right your project -> Add -> New Item -> Serive-based database then add. You can find the connection string in app.config file. While making the installer attach this database file along with your application (so there is no need to install SQL Server in customer machines).
Apr 27 '13 #30
imanjan
18 New Member
thank.
SO I don't need any Version of SQL in customer machines like SQL Express ?
Apr 27 '13 #31
vijay6
158 New Member
Hey imanjan, yes. You don't need.
Apr 27 '13 #32
imanjan
18 New Member
I'm really glad that
I was talking to you last week
and very happy to answer my important problem.
Apr 27 '13 #33
rdyanesh
1 New Member
@vijay6
can u tell about the local db connection in detail and how to make the setup file.

thanks in advance
Jul 13 '16 #34

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: ndsoumah | last post by:
hi all How can I make a database connection available to all the pages in my application? I tried doing it with session but it doesn't seem to work. here's what a did: start_session();
2
by: Job Lot | last post by:
How can I make my setup program create folders with specific name while installing application? I want to create these folders in application folder. Thanks
5
by: COHENMARVIN | last post by:
I have a sql server database hosted by an ISP. It has credit card fields. I want to make the database secure. My asp.net pages refer to the database as follows: strConnection =...
0
by: balaki | last post by:
Hi All, I have a Multilingual VB6 application, which rightnow supports French language. When I debug the code, it works in French, by changing the regional settings - locale to French(France)....
1
by: rshivaraman | last post by:
Hi All: I need to make my database unavailable when i am loading the db. This happens daily and the db is not connected to any online app, to make the app unavailable. It is queried thru an...
2
by: nizargermany | last post by:
Hello, i would like to create a setup file for my VB.net application. my application contain a DataSocket from National Instrument. so I must install the NI Software befor using the DataSocket. ...
1
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
I have a .sql script that holds the configuration of a local sql express database needed for my C# .net forms app. I would like the script to run. Right now, I have a install_db.cmd file that...
3
by: Elliot | last post by:
I have written a C# program and then make the setup project. I specify the prerequisite (.NET Framework 3.5) to be downloaded as the same location as my location. However, I find that my project...
2
ram09
by: ram09 | last post by:
i want to make a master server and a slave for my database ...do anyone have an idea on how i can setup a database replication on two different servers please???thanks^^
7
by: gina farrow | last post by:
Hello, I need to know what would be the best way to make a database that allows only 4 users to go into the form section, and click on the forms. once the database form is open, on the side of...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.