I have set the following SQL Script to remove the database when uninstalling,
Code: Select all
USE master
GO
ALTER DATABASE MyDatabase
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE MyDatabase;
Code: Select all
USE master
GO
ALTER DATABASE MyDatabase
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE MyDatabase;
This worked. Thank you.If you are using properties to store the parameter values I would recommend that you to go to the "Install Parameters" page and check the "Show properties with empty values or used in dialog controls" checkbox. Double click on the properties used to store the SQL Connection string parameters and check the "Set persistent property" option. This way the information used for the connection is saved and can be used to run the script on uninstall.