Microsoft.SqlServer.ConnectionInfo,
Microsoft.SqlServer.Management.Sdk.Sfc,
Microsoft.SqlServer.Smo,
Microsoft.SqlServer.SmoExtended
codes are follows -
ServerConnection conn;
Backup bkp = new Backup();
string subPath = "~/DatabaseBackup";
bool IsExists = System.IO.File.Exists(Server.MapPath(subPath + "\\ConDB.bak"));
if (IsExists) File.Delete(Server.MapPath(subPath + "\\ConDB.bak"));
string databaseName = "mydb";
bkp.Action = BackupActionType.Database;
bkp.Database = databaseName;
bkp.Devices.AddDevice(Server.MapPath(subPath) + "\\ConDB.bak", DeviceType.File);
bkp.Incremental = false;
conn = new ServerConnection(instanceName, userid,password);//put right values of ur server
srv = new Server(conn);
bkp.SqlBackup(srv);//does backup finally