kyusan93
kyusan93

Reputation: 422

Remove SQL Server database during uninstall of C# Winforms

I have created a MSI Installer via VS2010 Windows Installer.

I am able to setup the C# program, and able to attach the database to SQL Server Express.

How can I remove the .ldf file in my program files and delete the DB created during attachment to the SQL Server Express when I do a uninstall of my application?

Upvotes: 0

Views: 834

Answers (2)

alexmage
alexmage

Reputation: 115

Execute DROP DATABASE command in sql.

http://msdn.microsoft.com/en-us/library/ms178613.aspx

Upvotes: 1

TomTom
TomTom

Reputation: 62101

How can I remove the .ldf file in my program files and delete the DB created during attachment to the ms sql express when I do a uninstall of my application?

Two words: CUSTOM ACTION. Protram a cusomto maction executed during uninstall.

Upvotes: 1

Related Questions