zoukankan      html  css  js  c++  java
  • vb.net sqlserver

    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

  • 相关阅读:
    【ABAP】
    【Ebs】-日记账导入优化
    【EBS】-日记账审批相关知识点
    【LINUX】cron知识小结
    【Oracle】物化视图相关SQL
    【Ebs】EBS12.2.7 REST ISG的配置
    【Oracle】Windows上Oracle数据库的安装
    【EBS】菜单的复制脚本
    《我们内心的冲突》(卡伦•霍尼)读书笔记
    魔方攻略
  • 原文地址:https://www.cnblogs.com/tatsuya/p/1787354.html
Copyright © 2011-2022 走看看