Does anybody know how to backup SQL Server 2005/2008 database with C# and get the database backup progress?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a pure ADO.NET solution, if you are having difficulty installing SMO/SQLDMO on the target machine (it’s a pain in the behind, best avoided if you can).
The
stats = 1clause tells SQL Server to emit severity 0 messages at the specified percentage interval (in this case 1%). TheFireInfoMessageEventOnUserErrorsproperty andInfoMessageevent ensure that the C# code captures these messages during execution rather than only at the end.