在说C#操作数据库之前需要先说下ADO.NET.ADO.NET的名称起源于ADO(ActiveX Data Objects),是一个COM组件库,用于在以往的Microsoft技术中访问数据.之所以使用ADO.NET名称,是因为Microsoft希望表明,这是在NET编程环境中优先使用的数据访问接口. ADO.NET可让开发人员以一致的方式存取资料来源(例如 SQL Server 与 XML),以及透过 OLE DB 和 ODBC 所公开的资料来源.资料共用的消费者应用程序可使用ADO.NET
SQL语句操作增删查改助手类 using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text; namespace Ecio_Admin { /// <summary>SQL数据库助手类</summary> public class SqlHelper { //Sq
对数据仓库的操作(CURD): 新增: create database db_test; 新增的时候设置编码: create database da_test_1 character set utf-8; 删除: drop database da_test_1; 修改: 修改数据仓库的字符编码集: alter database db_test character set 'gbk'; 查看: 获取所有的数据仓库: show databases; 查看数据仓库的编码: show create d
1 SqlHelper源码 using System; using System.Data; using System.Xml; using System.Data.SqlClient; using System.Collections; namespace SQL.Access { /// <summary> /// SqlServer数据访问帮助类 /// </summary> public sealed class SqlHelper { #region 私有构造函数和方法