.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to duplicate database using asp.net

Posted By: Ashutosh Jha     Posted Date: December 26, 2013    Points:5   Category :ASP.Net
Hi All,

I am developing one application where i am using SQL Server 2008. I kept one sample database with complete structure and i want when admin will create login for another user a duplicate database should be created automatically with the structure same as the sample database and the newely user will use the duplicate database.

Responses
Author: Nagarajan             
Posted Date: December 28, 2013     Points: 20   

Hi,

We have option to Backup and Restore the DB in SQL. Take the Backup of master DB and Restore it in another DB. And Change the Connection string for New (Ordinary) User. Admin will take care of Master DB.


Author: Ashutosh Jha             
Posted Date: December 29, 2013     Points: 20   

Hi Nagarajan,

Thanks for the update. But can you tell me excately how it can be done. It will be really helpfull if you could provide any reference for this.

Regards,
Ashutosh Jha
ashutosh741@gmail.com

http://www.tricksroad.com
Author: Nagarajan             
Posted Date: January 04, 2014     Points: 20   

Hi Ashutosh,

Here you may find example for Copy DB and changing the connection string dynamically.

Copy DB:
http://msdn.microsoft.com/en-us/library/ms188664.aspx

Dynamic Connection string:
http://codebetter.com/petervanooijen/2006/08/11/change-a-database-connection-string-from-code/

Author: Ashutosh Jha             
Posted Date: January 06, 2014     Points: 20   

Thanks Nagarajan.
i will try and get abck to you if i need any help.

Regards,
Ashutosh Jha
ashutosh741@gmail.com

http://www.tricksroad.com


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend