0

I have an application extension which I need to test. Part of the extension applies some updates to the application database schema (via the applications API). i want to test that given version 1 of the application when my class is run the schema becomes v1.1 and that certain queries for items which should exist in 1.1 return correctly. I have backup of the database at schema v1.0 and what I would like to do in my tests is:

1/ restore the database from a backup

2/ call the code which does the update

3/ call several methods which verify that the schema updates have succeeded

4/restore the database from a backup

Are there classes I can use to do this restore in my c# code, or do I have to execute the command in shell process?

2
  • Are you running SQL Server or are you aiming to do this via something else like ODBC or MySQL? Commented Jan 15, 2010 at 16:02
  • I am running sql server, but an option that would allow this to work with oracle as well would be very useful Commented Jan 15, 2010 at 16:07

1 Answer 1

2

If you are uysing SQL Server, you could use the SQL Management objects (SMO)

An example can be found here

Kindness,

Dan

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.