惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
G
GRAHAM CLULEY
S
Securelist
P
Palo Alto Networks Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
B
Blog RSS Feed
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
K
Kaspersky official blog
D
Docker
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
H
Help Net Security
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
美团技术团队
腾讯CDC

博客园 - 毕业设计流程

脆弱的互联网 AVS全面学习[ZT] Google Apps for feison.com 冬天来了。 ATi Radeon系列显卡Omega加速驱动最新2.6.87版For Win2000/XP(2005年12月12日发布) 該出手時就出手,$2.99 /year/Domain [导入]梦幻快车(DreamMail) v4.0 正式版 ? [导入]没想到Discuz!免费了。 [导入]Realtek瑞昱ALC全系列AC97声音芯片驱动 3.80 [导入]續集 [导入]ffdshow_20051129 [导入]参加KC公测,短信免费发。 [导入]Skype Video Out [导入]101个办公模板。 [导入]Diamond Multimedia 复出,再入PC声卡市场! [导入]K-Lite Mega Codec Pack 1.45 开题报告 答辩PowerPoint 系统打包
怎样做sql server数据库的还原与排它性错误。
毕业设计流程 · 2005-06-02 · via 博客园 - 毕业设计流程

 1   void restoreButton_Click(object sender, System.EventArgs e)
 2   {
 3    string path = pathTextBox.Text;
 4    string dbname = dbDropDownList.SelectedValue;
 5
 6    string restoreSql = "use master;";
 7    restoreSql += "restore database @dbname from disk = @path;";
 8                string pai = "use master;ALTER DATABASE Wy SET OFFLINE WITH ROLLBACK IMMEDIATE;ALTER DATABASE Wy SET ONLINE WITH ROLLBACK IMMEDIATE";
 9                SqlConnection conn = new SqlConnection(ConnStr);
10                SqlCommand com1 = new SqlCommand(pai, conn);
11
12    SqlCommand myCommand = new SqlCommand(restoreSql, new SqlConnection(ConnStr));
13
14    myCommand.Parameters.Add("@dbname", SqlDbType.Char);
15    myCommand.Parameters["@dbname"].Value = dbname;
16    myCommand.Parameters.Add("@path", SqlDbType.Char);
17    myCommand.Parameters["@path"].Value = path;
18
19
20    try
21    {
22                    conn.Open();
23                    com1.ExecuteNonQuery();
24                    conn.Close();
25                    myCommand.Connection.Open();
26     myCommand.ExecuteNonQuery();
27                    infoLabel.Text = "恢复成功!<br>已经把备份"+path+"恢复到数据库";
28
29    }

30    catch(Exception ex)
31    {
32                    infoLabel.Text = "恢复失败!<br>出错信息如下:<br>" + ex.ToString();
33    }

34    finally
35    {
36     myCommand.Connection.Close();
37
38    }

39   }

40