1

how to backup/restore from database with using entity framework ?

Is it possible with entity framework 4.0 ?

I am using the c#4.0 and wpf and EF4.0

8
  • Entity Framework is an ORM - object-relational mapper - designed to handle interactions with single entities and/or short lists of entities. It's neither designed for bulk operations, nor is it a server admin framework. So no - I don't think you can do this using Entity Framework - that's not its job. Commented Oct 14, 2012 at 14:24
  • Why would you do this using Entity Framework, i miss the reason. What do you want to backup and restore, which kind of database? And like marc_s explained, it's just an advanced ORM. Executing queries under the hood. It would be possible to backup and restore a database, but that will be alot of coding and the execute time will never be as fast as any other backup and restore. Commented Oct 14, 2012 at 14:27
  • Use an appropriate tool for the job! Either use SQL Server Management Studio to handle backup/restore - or if you must do it programmatically, use the SMO (Server Management Objects) which is intended for exactly these kinds of jobs . Commented Oct 14, 2012 at 14:28
  • How do I get backup/restore Without EF. What is the best way? Commented Oct 14, 2012 at 14:30
  • @marc_s : please Give me an example with SMO. Commented Oct 14, 2012 at 14:31

1 Answer 1

0

Assuming you have SQL Express, and thus no SQL Agent. Maybe that is the reason you want to export using Entity Framework? You can always do it with SQL

I just found a link which explains how you can do it, but until now it is just all based on the fact that i think you don't have an SQL Agent and you want to make backups.

http://www.winblogs.net/index.php/2009/11/22/automating-backup-of-databases-in-sql-20052008-express/

PS: This question has been asked before, in another way, take a look at the following answer https://stackoverflow.com/a/9184833/578552

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.