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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
H
Heimdal Security Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Hacker News
The Hacker News
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
S
Securelist
P
Privacy International News Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
博客园 - 叶小钗
J
Java Code Geeks
V
V2EX
博客园 - Franky
Spread Privacy
Spread Privacy
K
Kaspersky official blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
C
CERT Recently Published Vulnerability Notes
Latest news
Latest news
NISL@THU
NISL@THU
罗磊的独立博客
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
V
Visual Studio Blog

博客园 - zhangbaoyu

Asp.net项目因Session阻塞导致页面打开速度变慢 jquery.chosen.js实现模糊搜索 SQL Server 使用日志传送 SQL Server 2008 R2 主从数据库同步 JavaScript及C# URI编码详解 sql server日期时间函数 MySQL十大优化技巧 - zhangbaoyu - 博客园 第一季 开封菜。。。。 Eval( " ")和DataBinder.Eval(Container.DataItem, " ") Navicat 一学生问英语老师“山寨”的英语怎么说,老师沉默不语。过了一会儿,幽幽的转过头来,一顿一顿的说道:made in china... MySQL DATE_FORMAT() 函数 js日期时间格式验证,时间比较 笔记本显卡排名 如何使用URL跳转解决Web服务80端口被封问题? 寒山诗选 c# 写入文件日志 - zhangbaoyu - 博客园 c# smtp发送邮件
vb.net sqlserver
zhangbaoyu · 2010-07-28 · via 博客园 - zhangbaoyu

2010-07-28 21:36  zhangbaoyu  阅读(345)  评论()    收藏  举报

Dim   strcon   As   String
                Dim   strsql   As   String
                Dim   con   As   SqlConnection
                Dim   com   As   SqlCommand
                Dim   databasepath   As   String
                Dim   pos   As   Integer

                databasepath   =   Application.ExecutablePath
                pos   =   InStrRev(databasepath,   "\ ")
                databasepath   =   Mid(databasepath,   1,   pos)   &   "backup\databaseback.bak "
               
                strcon   =   "server=localhost;database=humanadministration;uid=cxl;pwd=cxl; "
                con   =   New   SqlConnection(strcon)
                strsql   =   "backup   database   yourdatabase   to   disk= ' "   &   databasepath   &   " ' "
                com   =   New   SqlCommand(strsql,   con)

                Try

                        con.Open()
                        com.ExecuteNonQuery()
                        MessageBox.Show( "数据库备份成功! ",   "信息提示: ",   MessageBoxButtons.OK,   MessageBoxIcon.Information)

                Catch   ex   As   Exception
                        MessageBox.Show(ex.Message,   "错误提示: ",   MessageBoxButtons.OK,   MessageBoxIcon.Exclamation)
                Finally
                        con.Close()
                End   Try