62,271
社区成员
发帖
与我相关
我的任务
分享
string path = Server.MapPath("/bak/" + BakName);
string backupstr = "backup database "+SqlName+" to disk='" + path + "';";
SqlConnection con = new SqlConnection("server=" + SqlServer + ";uid=" + SqlUserName + ";pwd=" + SqlUserPass + ";");
SqlCommand cmd = new SqlCommand(backupstr, con);
//try
//{
con.Open();
cmd.ExecuteNonQuery();