views:

88

answers:

0

How can I easily delete all tables from my database (C# ASP.NET MVC 2 using SQL)? I created models to the data with the entities framework and have figured out how to insert data.

When I try

Entity1 test = new Entity1();
test.DeleteDatabase();

I get this error:

Unable to complete operation. The supplied SqlConnection does not specify an initial catalog.

Is there something obvious I can do to get this working? What's a better way to do this? Is there any easy way to use a stored procedure? What does the syntax for the stored proceeded look like to delete all of the rows in all of the tables?