 2006-11-17 21:12
	    2006-11-17 21:12
   2006-11-17 21:13
	    2006-11-17 21:13
   2006-11-18 21:02
	    2006-11-18 21:02
  “备份”CLICK事件代码,你参考下:
protected void btnBackup_Click(object sender, System.EventArgs e)
        {
            string strDBName = txtName.Text.Trim();
            string strPath = txtPath.Text.Trim();
            if( strDBName == String.Empty )
            {
                Response.Write("<script>");
                Response.Write("alert('请输入数据库名!!!');");
                Response.Write("</script>");
                return;
            }
            if( strPath == String.Empty )
            {
                Response.Write("<script>");
                Response.Write("alert('请输入要备份到的路径!!!');");
                Response.Write("</script>");
                return;
            }
            DateTime myTime=System.DateTime.Now;
            string strDTime = myTime.ToLongDateString();
                strDTime += "(";
                strDTime += myTime.Hour.ToString("00");
                strDTime += myTime.Minute.ToString("00");
                strDTime += myTime.Second.ToString("00");
                strDTime += ")";
            strPath += "SCardDB." + strDTime + ".bak";
            DBConn myDB = new DBConn();
            string mySql = "backup database " + strDBName + " to disk = '" + strPath + "'";
            int i = myDB.Update( mySql );
            myDB.Close();
            if( i == -1 )
            {
                Response.Write("<script>");
                Response.Write("alert('数据备份成功!!!');");
                Response.Write("</script>");
            }
        }
//txtName 是数据库名   txtPath是备份文件保存路径

 2006-11-20 13:25
	    2006-11-20 13:25
   2006-11-22 21:24
	    2006-11-22 21:24
  
 2006-11-24 07:48
	    2006-11-24 07:48
   2006-11-24 09:32
	    2006-11-24 09:32
   2006-11-25 09:03
	    2006-11-25 09:03
  恢复呢,如果用from disk的话,提示说数据库正在使用,不能访问!
 2006-12-04 13:45
	    2006-12-04 13:45