Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i finished my windows application using c# and sql database


C#
Data Source=.\\SQLEXPRESS;Initial Catalog=jesalesdb;Integrated Security=SSPI;Trusted_Connection=Yes



and i created setup file using visual studio.

what i should to do to make my program work good on another pc ( connect with database)

and where i should put the database ?

thanks..
Posted
Updated 26-Mar-15 2:51am
v2
Comments
Saral S Stalin 26-Mar-15 8:20am    
What are you developing? web or windows application? You should ideally put the database in a central database server, which should be accessible from all machines which runs application code. If you do not intend to share data between each individual installations you can consider RDBMSes like SQLLite
Golden Basim 26-Mar-15 8:56am    
windows application , so i must install sqlserver on pc ( that will be as server )?
how can i exoprt database from sql server ( on my pc) and attached to sql server (on customer pc )?
InbarBarkai 26-Mar-15 9:21am    
Do you really want to do it?
Installing and deploying servers on client machines seems like overkill.
If it is a small app maybe you could use a more light database like SQLite as suggested or even access.
That way, all you need to do is to add a clean version of the database to the install package.
Golden Basim 26-Mar-15 9:53am    
i went to make the application work on network , so i need sql server ..

there is method to install sql + athached the database + install my app from one file ??
i went the user install the app easy ..
InbarBarkai 26-Mar-15 9:55am    
If the application is a network one, all you need is to have the computer with the database accept network connections and change the connection string accordingly

And no. You need to install sql server on the machine and then import the database (You have many good tools for that).

You should not include SQL Server in your installation. There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.

If you don't need multiuser access to your data, then consider changing your code to use a single user system: SQLCE, SQLite, or even Access
 
Share this answer
 
Comments
Golden Basim 26-Mar-15 9:54am    
i went to make the application work on network
If you really developed and "finished your Windows application" and even "created setup file", I guess, you need to send it to the customer, to run it. :-)

But as you are in doubt, I would advise to make SQL server (SQL Express and all compatible versions of all SQL Server products) as one of prerequisites; and your installer can check it up. It depends in what installation toolkit you are using. Just for example, you can read how to do it with WiX (highly recommended):
http://www.advancedinstaller.com/forums/viewtopic.php?f=2&t=24127,
http://wix.tramontana.co.hu/tutorial/sql/creating-a-database,
http://sourceforge.net/p/wix/mailman/message/27011065.

Why not deploying SQL with your installation? Probably you can (check up your license and the rights for redistribution), but in this case better make it optional installation. Why? Because licensing is a complicated issue; and because the user need the opportunity to use the SQL server products they already have, or have a license, and it could be different from what you use. Generally, installations should be sometimes tested on a fresh computer. You can use a virtual machine for such purposes.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900