4 Answers, 1 is accepted
0
Hi Caleb,
Unfortunately dropping a database instance is not supported out of the box in the current OpenAccess ORM API. This is a design decision made mostly for safety reasons.
You can still create your own extension method to drop a database:
I hope this helps.
All the best,
Boris Georgiev
the Telerik team
Unfortunately dropping a database instance is not supported out of the box in the current OpenAccess ORM API. This is a design decision made mostly for safety reasons.
You can still create your own extension method to drop a database:
SqlConnection sqlConnection =
new
SqlConnection(@
"Server=servername;Integrated security=SSPI;database=master"
);
sqlConnection.Open();
string
databaseName =
"DeleteTest"
;
string
sql =
"DROP DATABASE "
+ databaseName;
SqlCommand cmd =
new
SqlCommand(sql, sqlConnection);
cmd.ExecuteNonQuery();
I hope this helps.
All the best,
Boris Georgiev
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Caleb
Top achievements
Rank 1
answered on 28 Nov 2012, 03:25 AM
Yeah, I already did that. But I was looking for a method that would work on all the supported databases. But it's fine. Are you planning to have support for that? Because migrating a database in the code only method bloats it with tables that are no longer in use and I have to delete it manually.
0
Hi Caleb,
Ivailo
the Telerik team
What we have currently in our backlog is a functionality that would allow you to configure which old tables would you like to remove. For the time being we prefer not to allow dropping the actual database, again for security reasons. However, we might consider it (with the necessary precautions and limitations) in case there is demand for it after we provide the drop tables feature.
Thank you for your input, we are looking forward to any additional feedback you might have for OpenAccess ORM.
Ivailo
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Caleb
Top achievements
Rank 1
answered on 03 Dec 2012, 05:05 AM
Okay, thank you for your assistance.