返學(xué)費(fèi)網(wǎng) > 培訓(xùn)機(jī)構(gòu) > 青島新通教育
備份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(); } |
青島正規(guī)的托福培訓(xùn)機(jī)構(gòu)(雅思托福對(duì)應(yīng)分?jǐn)?shù)怎么對(duì)比)
青島黃島區(qū)十大加拿大高中留學(xué)服務(wù)機(jī)構(gòu)排行榜(OSSD有課程能力提升優(yōu)勢(shì)嗎)
青島市北區(qū)排名前十加拿大美術(shù)留學(xué)中心排行榜(加拿大留學(xué)就業(yè)機(jī)會(huì))
青島黃島區(qū)十大加拿大留學(xué)中介服務(wù)機(jī)構(gòu)排名(留學(xué)加拿大優(yōu)勢(shì)有哪些)
只要一個(gè)電話
我們免費(fèi)為您回電