Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am a developer,

I have created one WinForm Application on my PC with SQL-Server as BackEnd Database.

Now I have installed my application on Client PC and I required to copy Database I have

created on my PC should be copy to client PC.

I don’t required to install entire Sql Server Management studio on Client Machine.

It is good I just installing SQL-Server on Client PC and Adding my Database on Clients

PC’s SQLServer without installing SQLServer Management Studio.

Does it possible? then please help me….

Thanks…..
Posted

You can write a script that restores a backup, and run it using C# code.
 
Share this answer
 
Comments
Algorithm_Seeker 11-Aug-11 4:28am    
thank you so much for answering.

BTW, how to execute script using C# code
Backup - restore combination is one possibility: http://msdn.microsoft.com/en-us/library/ms186865.aspx[^]

Another option is to use detach - attach operations: http://msdn.microsoft.com/en-us/library/ms190794.aspx[^]
 
Share this answer
 
No. And you shouldn't do it anyway.
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 are trying to prevent them from playing with the database by not installing SQL management Studio, then you would be much, much better off using a single user database that does not require any management.
 
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