日本亚洲欧美日韩中文字幕_精品欧美一区二区三区久久久_久久av高潮av无码av_成在人线av无码免费_亚洲中文字幕无码久久精品1

15757356768

全國(guó)統(tǒng)一學(xué)習(xí)專線 8:30-21:00

 備份SqlServer數(shù)據(jù)庫(kù):

以下是代碼片段:
    string SqlStr1 = "Server=(local);database='" + this.DropDownList1.SelectedValue + "';Uid=sa;Pwd=";
  string SqlStr2 = "backup database " + this.DropDownList1.SelectedValue + " to disk='" + this.TextBox1.Text.Trim() + ".bak'";
  SqlConnection con = new SqlConnection(SqlStr1);
  con.Open();
  try
  {
  if (File.Exists(this.TextBox1.Text.Trim()))
  {
  Response.Write(" ");
  return;
  }
  SqlCommand com = new SqlCommand(SqlStr2, con);
  com.ExecuteNonQuery();
  Response.Write(" ");
  }
  catch (Exception error)
  {
  Response.Write(error.Message);
  Response.Write(" ");
  }
  finally
  {
  con.Close();
  }

  還原SqlServer數(shù)據(jù)庫(kù):

以下是代碼片段:
    string path = this.FileUpload1.PostedFile.FileName; //獲得備份路徑及數(shù)據(jù)庫(kù)名稱
  string dbname = this.DropDownList1.SelectedValue;
  string SqlStr1 = "Server=(local);database='" + this.DropDownList1.SelectedValue + "';Uid=sa;Pwd=";
  string SqlStr2 = "use master restore database " + dbname + " from disk='" + path + "'";
  SqlConnection con = new SqlConnection(SqlStr1);
  con.Open();
  try
  {
  SqlCommand com = new SqlCommand(SqlStr2, con);
  com.ExecuteNonQuery();
  Response.Write(" ");
  }
  catch (Exception error)
  {
  Response.Write(error.Message);
  Response.Write(" ");
  }
  finally
  {
  con.Close();
  }

溫馨提示:為不影響您的學(xué)業(yè),來校區(qū)前請(qǐng)先電話咨詢,方便我校安排相關(guān)的專業(yè)老師為您解答
  • 熱門課程
  • 作者最新文章
  • 在線報(bào)名
申請(qǐng)?jiān)嚶犝n程

只要一個(gè)電話
我們免費(fèi)為您回電

姓名不能為空
手機(jī)號(hào)格式錯(cuò)誤