"Abhijit Taur" wrote:
hi
i am using vb.net2005
i want to take daily backup from application
and attach that daily backup if any data loss
You need to use Microsoft.SqlServer.Management objects
using System.Data.SqlClient;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;
....
using (SqlConnection conn = new SqlConnection(connString))
{
ServerConnection serverConnection = new ServerConnection(conn);
Server server = new Server(serverConnection);
Backup backup = new Backup();
backup.SqlBackup(server);
}
Translate to vb.net as necessary (PS you did as a C# group :P )
You will most likely have to set several properties on the Backup object
before calling SqlBackup, as well as subscribe to events.
--
Happy Coding!
Morten Wennevik [C# MVP]