DiscountASP.NET SQL Backup v2.0

by Frank Perez November 1, 2013

It has been over two years since I released the first version of DSB (DiscountASP.NET SQL Backup). In that time I have received some good feedback and really enjoyed working on this project. Today I'm proud to release the next version of DSB with some very cool features.

  • Installation Program
  • User Interface
  • Schedule Settings
  • SQL Compact Data
  • Digitally Signed

Installation Program

DSB now includes a real installation program. The installation program will automatically verify that all of the required components (Microsoft .NET Framework 4.5 and Microsoft SQL Server Compact 4.0) exist. If a required component doesn't exist, the installation program will download and install it.

User Interface

DSB now includes a user interface. The user interface simplifies the setup process and makes interacting with DSB easier.

Account List

The Account List is the main form. This form displays the current status of every account, is used to perform account maintenance (new, edit, delete), and access the logs.

Service Menu

  • Start: starts the service in the Service Control Manager.
  • Stop: stops the service in the Service Control Manager.
  • Restart: restarts the service in the Service Control Manager.
  • Install: installs the service in the Service Control Manager.
  • Uninstall: uninstalls the service from the Service Control Manager.


  • New Account: displays the Account Maintenance with a new account.
  • Edit Account: displays the Account Maintenance form for the selected account.
  • Delete Account: permanently deletes the selected account and all of the corresponding logs.
  • Account Logs: displays the Log List form for the selected account.
  • Import Accounts: creates account by importing settings from DSB v1.

Account Maintenance

The Account Maintenance form is used to define the account settings. This form includes the ability to test the settings and to manually perform the backup process.


  • Account Settings: Description and API Key are required.
  • Database Settings: Backup Type and Database Name are required.
  • FTP Settings: FTP Folder, FTP User Name, and FTP Password are required.
  • Local Folder Settings: Local Folder is required.
  • SMTP Settings: optional.
  • Notification Settings: optional.
  • Schedule Settings: all settings are required.

Test Button

The Account, Database, FTP, Local Folder, and SMTP settings include a Test button. Keep in mind that if you run DSB as a Windows Service, the credentials you test with could have different rights than the Windows Service.

Run Now Tool Button

The Run Now button can be used to manually perform the backup process.

Log List

The Log List form displays the account logs.

Schedule Settings

DSB now includes the ability to schedule when and how often the backup process is performed. Keep in mind that these settings only apply if DSB is ran as a Windows Service. Also, DiscountASP limits how often a backup can be performed. The current limit is once every 6 hours.

SQL Compact Data

DSB now stores the account information and logs in a SQL Compact 4.0 Database. The database is located in the Common Program Data folder. On a Windows 7 PC, this equates to C:\ProgramData\PF Solutions\DASP SQL Backup\.

Digitally Signed

All of the DSB EXE and DLL files are now digitally signed.



Filed Under: .NET | DSB

DiscountASP.NET SQL Backup v1.4

by Frank Perez June 14, 2012

Earlier this week I received an email asking if the DSB (DiscountASP.NET SQL Backup) application could do secure FTP transfers. At first I assumed that an SSL certificate would be required, but I did some quick research on the DiscountASP Support Portal anyways. There I found a Knowledge Base Article showing that DiscountASP allows FTP over SSL on all IIS7 accounts.

Thinking this would be a great feature, I modified the DSB application to check for the Databases.XML file for a FtpEnableSsl setting. If the setting is “true”, a SSL connection is used for all FTP data and commands.

After some quick testing on two PCs, I sent the DSB v1.3 update. Later that evening I received an email thanking me for the change and quick response. It always feels good when someone appreciates your work.

The next day, I received an email from the same person stating they were having a problem restoring the backups. They had tried restoring a backup created with DSB v1.3 and an earlier release. In both tests, the restore in SQL Server failed with a "RESTORE FILELIST is terminating abnormally" error message.

As everyone should know, it is not a wise idea to backup a system and assume that the backups are good. It is important to periodically test the backups by restoring them. This was something I recall doing when I first created the DSB application. Unfortunately, I had not been repeating the restore test with every new release. So I grabbed my last SQL Server backup, attempted to perform a restore, and sighed when I got the exact same error.

After I got over the initial shock, I jumped right into the code and found the source of the problem. In the FTP Download process I was using the wrong class for writing the BAK file to the local disk. I fixed the code, and then retested the entire process (backup, download, and restore) on two different PCs with two different DiscountASP accounts. With everything working on my system, I sent the DSB v1.4 update to the user. The next day I received a response that the backup and restore process were now working on their system.

Moving forward, I will be sure to test the backup, download, and restore process with every new release. I will also be researching ideas for how I can notify users of important updates other than relying on this blog. I apologize for any problems this issue causes.

Enabling FTP over SSL in IIS7


Filed Under: .NET | DSB

DiscountASP.NET SQL Backup v1.0.0.0

by Frank Perez December 4, 2011

It has been more than 6 months since I released the DiscountASP.NET SQL Backup utility. In that time I have received some good feedback and zero problems (excluding installation issues). Based on this, I'm ready to release v1 with a minor enhancement.

One of the most requested features I received was the ability to specify when the backup process is performed. By default, the DiscountASP.NET SQL Backup utility performs the Microsoft SQL Database Backup process at 12:00AM every day. Rather than trying to create my own scheduling system I decided to take advantage of the system that is already included in Windows - Task Scheduler.

Step 1: From the Actions menu, select the Create Basic Task... menu option.

Step 2: Name the task.

Step 3: Select when you want the task to start.

Step 4: Identify how often the task should be started.

Step 5: Select what action you want the task to perform.

Step 6: Enter the fullpath and filename of the DSB.Service.EXE file into the Program/script field. Be sure to include "-console" in the Add Arguments field. You will also need to include the fullpath in the Start in field.

Step 7: Click Finish.

If you would like a copy of this application, you can download the latest version from

If you want to read all the blog posts on this topic

DiscountASP.NET Control Panel API
Microsoft .NET Framework 4 Client Profile


Filed Under: .NET | DSB

DiscountASP.NET SQL Backup v0.1.0.0

by Frank Perez May 5, 2011

A little over 6 months ago I started an ASP.NET MVC project for a client. During the planning phase we evaluated several web hosting companies and in the end choose DiscountASP.NET. One of the reasons we selected DiscountASP.NET is the Control Panel API feature.

The DiscountASP.NET Control Panel API allows us to programmatically manage our web hosting account. For example, we can manage email accounts, check bandwidth usage, and etc. All of these management functions are nice, but the one API feature that interested us the most was the ability to automate backups of the Microsoft SQL Database.

Look, I think it is important to choose a web hosting service provider who is reliable. However, any system can fail and data can be lost. Therefore, it is more important to not only choose a company you can depend on, but to utilize every feature you can to protect yourself. For this project, the ability to automatically perform a nightly backup of the website data and then download the backup to local storage was another layer of protection from a total data loss scenario.

With a simple goal of automating the Microsoft SQL Database Backup process and downloading the files to local storage, I started thinking about the features this process would need. Here is what I came up with:

  • Multiple Database Support - currently my client only has one hosted database, but I can see that changing in the future.
  • Purge Old Backups - the option to remove backups from the local storage that are more than XX days old.
  • Email Notification - the option to notify me if when a backup was performed and if the process was successful or failed.

Based on these criteria, I created the DASP SQL Backup application (DSB.Service.EXE) for performing automatic backups of a DiscountASP.NET MSSQL database. This application installs as a Windows Service and runs in the background without any user interface. Running the application as a service adds the ability to use the Windows Service Control Manager to Start, Stop, Pause, Resume, and Restart the application. In addition, there is no need to worry about restarting the application if the PC is rebooted, because the service can be set to automatically start on boot up.

The DSB.Service.EXE application records all events (success, failure, error) in the Windows Application Event Log with a Source of DASP SQL Backup. By recording events in the Windows Application Event Log, I can use the Windows Event Viewer to see what happened and when. I also don't have to worry about purging old events, because Windows can handle this automatically.

The DSB.Service.EXE application includes command line options for installing, uninstalling, starting, and stopping the service. Keep in mind that Administrative privileges are required to perform these commands.

All configuration settings are stored in two XML files: Databases.XML and DSB.Service.exe.config. At this point I did not create a user interface for modifying these files. This is something that I am considering for the future.

If you would like a copy of this application, you can download the latest version from The following is a list of important notes:

  • This application requires the Microsoft .NET Framework 4 Client Profile.
  • You must enable the DiscountASP.NET Control Panel API.
  • Be sure to read the README.TXT file for instructions on installing the service and how to modify the configuration files.
  • I'd love to hear any feedback. What do you like, what do you not like, what kind of features would you like to see in future versions?

DiscountASP.NET Control Panel API
Microsoft .NET Framework 4 Client Profile


Filed Under: .NET | DSB

About Frank

Frank lives in West Bloomfield, Michigan with his wife and three children.  When he is not writing code, he enjoys long distance running and riding his motorcycle.

Month List

Tag Cloud