资源简介

C#操作Sql数据库的例子

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BackupSql
{
    public partial class DBTools : Form
    {
        private static DBTools _Instance = null;

        public static DBTools Instance()
        {
            if (_Instance == null)
            {
                _Instance = new DBTools();
            }
            else
            {
                MessageBox.Show(“已经有一个实例在运行!“);
            }
            return _Instance;
        }


        public DBTools()
        {
            InitializeComponent();
        }

        private void GetSQLServerList()
        {
            //get all available SQL Servers    
         

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-04-12 10:35  .vs\
     目录           0  2020-04-12 10:35  .vs\BackupSql\
     目录           0  2020-04-12 10:35  .vs\BackupSql\v16\
     文件       39936  2020-04-12 10:39  .vs\BackupSql\v16\.suo
     目录           0  2020-04-12 10:35  .vs\BackupSql\v16\Server\
     目录           0  2020-04-12 10:39  .vs\BackupSql\v16\Server\sqlite3\
     文件           0  2020-04-12 10:35  .vs\BackupSql\v16\Server\sqlite3\db.lock
     文件      598016  2020-04-12 10:39  .vs\BackupSql\v16\Server\sqlite3\storage.ide
     目录           0  2020-04-12 10:35  Backup\
     文件        3747  2008-05-18 17:54  Backup\BackupSql.csproj
     文件       18654  2020-04-11 18:51  Backup\DBTools.Designer.cs
     文件        8083  2009-04-22 09:05  Backup\DBTools.cs
     文件        6226  2008-05-19 12:12  Backup\DBTools.resx
     文件      950272  2008-05-18 17:54  Backup\Interop.SQLDMO.dll
     文件         470  2008-05-18 13:20  Backup\Program.cs
     目录           0  2020-04-12 10:35  Backup\Properties\
     文件        1190  2008-05-18 13:19  Backup\Properties\AssemblyInfo.cs
     文件        3091  2008-05-18 15:28  Backup\Properties\Resources.Designer.cs
     文件        6199  2008-05-18 15:28  Backup\Properties\Resources.resx
     文件        1092  2008-05-18 13:19  Backup\Properties\Settings.Designer.cs
     文件         249  2008-05-18 13:19  Backup\Properties\Settings.settings
     目录           0  2020-04-12 10:39  Backup\Resources\
     文件        3872  2020-04-12 10:37  BackupSql.csproj
     文件        1122  2020-04-12 10:35  BackupSql.sln
     文件       18654  2020-04-11 18:51  DBTools.Designer.cs
     文件        8083  2009-04-22 09:05  DBTools.cs
     文件        6226  2008-05-19 12:12  DBTools.resx
     文件      950272  2008-05-18 17:54  Interop.SQLDMO.dll
     文件         470  2008-05-18 13:20  Program.cs
     目录           0  2019-08-04 15:43  Properties\
     文件        1190  2008-05-18 13:19  Properties\AssemblyInfo.cs
............此处省略26个文件信息

评论

共有 条评论