好久不接触这些闲暇时间回顾一下以前的基础。因为平常使用的时候都是直接调用SqlDB.dll这个类。先看这个类的结构

纸上得来终觉浅,绝知此事要躬行。个人觉得里面的标准操作就是对数据库增删查改 。特别适合初学者操作数据库,当初我也是那么来的。下面直接贴代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Configuration;
using System.Text; namespace FileUpDownThroou
{
/// <summary>
/// SqlServer访问类
/// </summary>
public class SqlDB
{
#region <——————————定义参数——————————>
/// <summary>
/// 数据库链接字符串
/// </summary>
protected readonly string SqlConning = ConfigurationManager.ConnectionStrings["ConnSqlString"].ConnectionString;
/// <summary>
/// 数据库链接对象
/// </summary>
private SqlConnection sqlConnection;
/// <summary>
/// 数据库事务对象
/// </summary>
private SqlTransaction sqlTransaction;
/// <summary>
/// 构造函数创建数据库链接
/// </summary>
#endregion #region<——————————构造函数——————————>
public SqlDB()
{
if(sqlConnection==null)
{
sqlConnection = new SqlConnection(SqlConning);
sqlConnection.Open();
}
}
#endregion #region <——————————事务处理——————————>
public SqlTransaction SqlTran
{
get { return sqlTransaction; }
set { sqlTransaction = value; }
}
/// <summary>
/// 打开数据链接
/// </summary>
public void OpenConnection()
{
if(sqlConnection != null && sqlConnection.State != ConnectionState.Open)
{
sqlConnection.Open();
}
}
/// <summary>
/// 关闭数据库链接
/// </summary>
public void CloseConnection()
{
if(sqlConnection != null && sqlConnection.State==ConnectionState.Open)
{
sqlConnection.Close();
}
}
/// <summary>
/// 开始一个数据库事务
/// </summary>
/// <param name="isolationlevel">链接的事务锁定行为</param>
public void BeginTransaction(IsolationLevel isolationlevel)
{
if(sqlConnection.State==ConnectionState.Closed)
{
sqlConnection.Open();
}
try
{
SqlTran = sqlConnection.BeginTransaction(isolationlevel);
}
catch(SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch(Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 开始一个数据库事务
/// </summary>
public void BeginTransaction()
{
if (sqlConnection.State == ConnectionState.Closed)
{
sqlConnection.Open();
} try
{
SqlTran = sqlConnection.BeginTransaction();
}
catch (SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch (Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 提交一个数据库事务
/// </summary>
public void CommitTransaction()
{
try
{
sqlTransaction.Commit();
CloseConnection();
}
catch(SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch(Exception e)
{
throw new Exception(e.StackTrace);
}
}
/// <summary>
/// 回退一个数据库事务
/// </summary>
public void RollBackTransaction()
{
try
{
SqlTran.Rollback();
CloseConnection(); }
catch (SqlException ex)
{
throw new Exception(ex.StackTrace);
}
catch (Exception e)
{
throw new Exception(e.StackTrace);
}
}
#endregion #region <——————————标准操作——————————> /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="commandBehavior">查询影响说明</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters, CommandType commandType, CommandBehavior commandBehavior)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteReader(commandBehavior);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return ExecuteDataReader(Sql, parameters, commandType, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql, List<SqlParameter> parameters)
{
return ExecuteDataReader(Sql, parameters, CommandType.Text, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回SqlDataReader
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>满足条件的SqlDataReader</returns>
public SqlDataReader ExecuteDataReader(string Sql)
{
return ExecuteDataReader(Sql, null, CommandType.Text, CommandBehavior.Default);
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteScalar();
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql, List<SqlParameter> parameters)
{
return ExecuteScalar(Sql, parameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回单个对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>满足条件的单个对象</returns>
public object ExecuteScalar(string Sql)
{
return ExecuteScalar(Sql, null, CommandType.Text);
} /// <summary>
/// 执行非查询类的Sql语句
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
return CreateSqlCommand(Sql, parameters, commandType).ExecuteNonQuery();
} /// <summary>
/// 执行非查询类的Sql语句z
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql, List<SqlParameter> parameters)
{
return ExecuteNonQuery(Sql, parameters, CommandType.Text);
} /// <summary>
/// 执行非查询类的Sql语句
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>成功执行所影响的记录数</returns>
public int ExecuteNonQuery(string Sql)
{
return ExecuteNonQuery(Sql, null, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataTable dataTable = new DataTable();
dataAdapter.Fill(dataTable);
return dataTable;
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataTable(Sql, sqlParameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataTable
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataTable</returns>
public DataTable ExecuteDataTable(string Sql)
{
return ExecuteDataTable(Sql, null, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text);
} /// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql)
{
return ExecuteDataSet(Sql, null, CommandType.Text);
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType, int PageIndex, int PageSize)
{
//设置导入的起始地址
int firstPage = PageIndex * PageSize; SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet, firstPage, PageSize, "PranaTable"); return dataSet;
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text, PageIndex, PageSize);
} /// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, null, CommandType.Text, PageIndex, PageSize);
} /// <summary>
/// 创建Sql命令对象
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>成功创建的SqlCommand对象</returns>
private SqlCommand CreateSqlCommand(string Sql, List<SqlParameter> parameters, CommandType commandType)
{
SqlCommand sqlCommand = new SqlCommand(Sql, sqlConnection, SqlTran);
sqlCommand.CommandType = commandType;
if (parameters != null)
{
foreach (SqlParameter parameter in parameters)
{
sqlCommand.Parameters.Add(parameter);
}
}
return sqlCommand;
} #endregion #region <——————————缓存操作——————————> /// <summary>
/// Hashtable中缓存的参数
/// </summary>
private static Hashtable parmCache = Hashtable.Synchronized(new Hashtable()); /// <summary>
/// 缓存查询的OleDb参数对象.
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="cmdParms"></param>
public void CacheParameters(string cacheKey, params SqlParameter[] cmdParms)
{
parmCache[cacheKey] = cmdParms;
} /// <summary>
/// 从缓存获取指定的参数对象数组.
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public SqlParameter[] GetCachedParameters(string cacheKey)
{
SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (cachedParms == null)
{
return null;
} SqlParameter[] clonedParms = new SqlParameter[cachedParms.Length];
for (int i = , j = cachedParms.Length; i < j; i++)
{
clonedParms[i] = (SqlParameter)((ICloneable)cachedParms[i]).Clone();
} return clonedParms;
} #endregion #region <——————————增删改查——————————> private static bool haveTransaction = false; public static bool HaveTransaction
{
get
{
return haveTransaction;
}
set
{
haveTransaction = value;
}
} /// <summary>
/// 查询字符串的默认长度
/// </summary>
private const int defaultCommandTextLength = ; /// <summary>
/// 根据表名等参数创建数据库查询语句
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="topNum">返回的记录数</param>
/// <param name="field">字段名称</param>
/// <param name="condition">条件</param>
/// <param name="order">排序字段</param>
/// <returns>数据库查询语句</returns>
private StringBuilder CreateSqlCommandText(string tableName, int topNum, string field, string condition, string order)
{
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.Append("SELECT ");
if (topNum > )
{
Sql.AppendFormat("TOP {0} ", topNum);
}
Sql.AppendFormat("{0} FROM {1} ", field, tableName);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0} ", condition);
}
if (order != null && order.Trim().Length != )
{
Sql.AppendFormat(" ORDER BY {0}", order);
}
return Sql;
} /// <summary>
/// 向表中插入数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="field">字段名称字符串</param>
/// <param name="fieldValue">字段值参数字符串</param>
/// <param name="parameters">字段参数集合</param>
/// <returns>成功插入的记录数</returns>
public int Insert(string tableName, string field, string fieldValue, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("INSERT INTO {0}({1}) VALUES({2});", tableName, field,
fieldValue);
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
} } /// <summary>
/// 从表中删除数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="condition">删除条件</param>
/// <param name="parameters">删除条件参数集合</param>
/// <returns>成功删除的记录数</returns>
public int Delete(string tableName, string condition, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("DELETE FROM {0} ", tableName);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0}", condition);
}
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
}
} /// <summary>
/// 根据条件修改表中的数据
/// </summary>
/// <param name="tableName">表名称</param>
/// <param name="fieldValue">字段名城</param>
/// <param name="condition">修改条件</param>
/// <param name="parameters">修改参数集合</param>
/// <returns>成功修改的记录数</returns>
public int Update(string tableName, string fieldValue, string condition, List<SqlParameter> parameters)
{
try
{
if (HaveTransaction == false)
{
OpenConnection();
}
StringBuilder Sql = new StringBuilder(defaultCommandTextLength);
Sql.AppendFormat("UPDATE {0} SET {1} ", tableName, fieldValue);
if (condition != null && condition.Trim().Length != )
{
Sql.AppendFormat("WHERE {0}", condition);
}
return ExecuteNonQuery(Sql.ToString(), parameters);
}
finally
{
if (HaveTransaction == false)
{
CloseConnection();
}
}
} #endregion }
}

里面的每个方法都有注解,应该都看的清楚。增删查改都有不同的重载

就像这个DetSet就有5个重载 用的时候根据需要就可以。

/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType)
{
SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
}

/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text);
}

/// <summary>
/// 执行Sql语句返回DataSet
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <returns>DataSet</returns>
public DataSet ExecuteDataSet(string Sql)
{
return ExecuteDataSet(Sql, null, CommandType.Text);
}

/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="commandType">命令类型</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, CommandType commandType, int PageIndex, int PageSize)
{
//设置导入的起始地址
int firstPage = PageIndex * PageSize;

SqlDataAdapter dataAdapter = new SqlDataAdapter(CreateSqlCommand(Sql, sqlParameters, commandType));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet, firstPage, PageSize, "PranaTable");

return dataSet;
}

/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="parameters">参数集合</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, List<SqlParameter> sqlParameters, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, sqlParameters, CommandType.Text, PageIndex, PageSize);
}

/// <summary>
/// 执行查询,返回查询的分页结果数据集
/// </summary>
/// <param name="Sql">Sql语句</param>
/// <param name="PageIndex">页索引</param>
/// <param name="PageSize">每页的记录数</param>
/// <returns>分页结果数据集</returns>
public DataSet ExecuteDataSet(string Sql, int PageIndex, int PageSize)
{
return ExecuteDataSet(Sql, null, CommandType.Text, PageIndex, PageSize);
}

Asp.Net中对操作Sql Server 简单处理的SqlDB类的更多相关文章

  1. 在易语言中调用MS SQL SERVER数据库存储过程方法总结

    Microsoft SQL SERVER 数据库存储过程,根据其输入输出数据,笼统的可以分为以下几种情况或其组合:无输入,有一个或多个输入参数,无输出,直接返回(return)一个值,通过output ...

  2. SQL Server学习之路(七):Python3操作SQL Server数据库

    0.目录 1.前言 2.准备工作 3.简单测试语句 4.提交与回滚 5.封装成类的写法 1.前言 前面学完了SQL Server的基本语法,接下来学习如何在程序中使用sql,毕竟不能在程序中使用的话, ...

  3. [转]C#操作SQL Server数据库

    转自:C#操作SQL Server数据库 1.概述 ado.net提供了丰富的数据库操作,这些操作可以分为三个步骤: 第一,使用SqlConnection对象连接数据库: 第二,建立SqlComman ...

  4. Python 学习笔记:Python 操作 SQL Server 数据库

    最近要将数据写到数据库里,学习了一下如何用 Python 来操作 SQL Server 数据库. 一.连接数据库: 首先,我们要连接 SQL Server 数据库,需要安装 pymssql 这个第三方 ...

  5. PHP操作SQL Server 2008/2012

    PHP操作SQL Server驱动,微软官方提供2个版本,Version 2.0 和 Version 3.0 Version 2.0 版本支持的操作系统有: Windows Server 2003 S ...

  6. 在打包程序中自动安装SQL Server数据库 .

    原文:在打包程序中自动安装SQL Server数据库 . 1.创建安装项目“Setup1”安装项目 在“文件”菜单上指向“添加项目”,然后选择“新建项目”. 在“添加新项目”对话框中,选择“项目类型” ...

  7. 数据库SQL Server2012笔记(七)——java 程序操作sql server

    1.crud(增删改查)介绍:create/retrieve/update/delete 2.JDBC介绍 1)JDBC(java database connectivity,java数据库连接) 2 ...

  8. 使用php来访问操作sql server

    使用php来访问操作sql server 在此分成三步走: 第一部:查看配置,下载文件 首先查看自己的php和sql server版本 Php文件输入echo PHP_VERSION  运行脚本就可以 ...

  9. Nodejs 操作 Sql Server

    Nodejs 操作 Sql Server Intro 最近项目需要爬取一些数据,数据有加密,前端的js又被混淆了,ajax请求被 hook 了,有些复杂,最后打算使用 puppeteer 来爬取数据. ...

随机推荐

  1. Elasticsearch简介和安装对比

    各位小伙伴,又到了本期分享大数据技术的时间,本次给大伙带来的是Elasticsearch这个技术,闲话不多聊,我们开始进入正题. 一.什么是elasticsearch Elasticsearch是一个 ...

  2. Spark基础-scala学习(七、类型参数)

    类型参数是什么 类似于java泛型,泛型类 泛型函数 上边界Bounds 下边界 View Bounds Context Bounds Manifest Context Bounds 协变和逆变 Ex ...

  3. 机器学习入门09 - 特征组合 (Feature Crosses)

    原文链接:https://developers.google.com/machine-learning/crash-course/feature-crosses/ 特征组合是指两个或多个特征相乘形成的 ...

  4. Python代码规范之---代码不规范,亲人两行泪

    任何语言的程序员,编写出符合规范的代码,是开始程序生涯的第一步! 关于代码规范 Python 官方提供有一系列 PEP(Python Enhancement Proposals) 文档 其中第 8 篇 ...

  5. 爬虫不过如此(python的Re 、Requests、BeautifulSoup 详细篇)

    网络爬虫(又被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本. 爬虫的本质就是一段自动抓取互联网信息的程序,从网络获取 ...

  6. python读取pdf文件

    pdfplumber简介 Pdfplumber是一个可以处理pdf格式信息的库.可以查找关于每个文本字符.矩阵.和行的详细信息,也可以对表格进行提取并进行可视化调试. 文档参考https://gith ...

  7. 【ABP框架系列学习】N层架构(3)

    目录 0.引言 1.DDD分层 2.ABP应用构架模型 客户端应用程序(Client Applications) 表现层(Presentation Layer) 分布式服务层(Distributed ...

  8. Linux编程 20 shell编程(shell脚本创建,echo显示信息)

    一概述 前面19章里已经掌握了linux系统和命令行的基础知识,从本章开始继续学习shell脚本的基础知识.在大量编辑shell脚本前,先来学习下一些基本概念. 1.1    使用多个命令 Shell ...

  9. sql server 高可用故障转移(5)

    测试故障转移群集报告 在SQL-CL01(hsr 50)进行故障转移群集的创建,如图下图所示,在SQL-CL01和SQL-CL02的“服务器管理”中右键点击“功能”,选择“添加功能 勾选故障转移群集  ...

  10. ZOJ Problem Set - 3706

    #include <cstdio> #include <cstdlib> #include <cstring> #include <set> #incl ...