See Document | 查看中文文档

Prjoect Description

DataVeryLite is a lightweight *Persistence Framework*.

请先获取源代码! 更多下载

数 据 库 是 否 支 持 描 述
MySql 预 览
SqlServer 预 览
Sqlite 预 览
Access 预 览
PostpreSql 预 览
Oracle 预 览
Db2 预 览
Sysbase 计 划 中

DataVeryLite 文档目录

发布历史

关于DataVeryLite
    基于.net 4.0的c#轻量级持久化框架
    支持vs2010开发
    支持vs2012开发

项目使命
    Easy to use.
    No config.

相关链接
blogs:
    http://blog.sina.com.cn/cshuqizhao
    http://www.cnblogs.com/shuqizhao/
email:
    shuqizhao@qq.com

版本信息
+2013-6-14 v0.0.1.0beta
      +支持Oracle
      +支持Db2
      +支持MySql
      +支持PostgreSql
      +支持SqlServer
      +支持Sqlite
      +支持Access

快速开始

Hello world!
  1,首先获取最新的发布版本,请到DOWNLOADS页面下载
  2,然后用vs2010或vs2012打开解决方案(.sln)
  3,最后按F5运行代码,你可以在VS的输出窗口查看DEBUG信息

使用指导

目录结构
    一个典型的DataVeryLite项目包括,Drivers和Models两个文件夹。你可以在DataVeryLite.Test项目的目录中找到这两个文件夹。
    Drivers文件夹中包含所有支持的数据库的驱动dll,你可以根据你的项目情况手动删除一些dll,但不建议你这样做。
    Models文件夹包含T4模版,其中Model.tt是数据库到实体类转换的T4模版,一般我们生成或更新实体类,需要执行该模版。执行一个T4模版只需要保存该模版即可。

项目类型
    在DataVeryLite项目中包含当前项目和启动项目两种项目类型。
    当前项目就是实体类所在项目。在当前项目中必须包含Drivers和Models两个文件夹。
    启动项目就是vs的启动项目。在启动项目中必须包含App.config或Web.config,以及在节点connectionStrings中提供需要的连接字符串。
    启动项目和当前项目都必须添加对DataVeryLite.dll的引用,该dll位于Drivers文件夹中。
    当然,当前项目也可以是启动项目,就像DataVeryLite.Test项目一样。在开发时必须指定一个vs启动项目,否则T4模版无法为你转换实体类。

T4模版
    在Models文件夹下面有一个Model.tt文件,该T4模版提供将数据库中的表转换成c#中的实体类的能力。
    如果启动项目是Web项目,并且当前项目不是启动项目,T4模版会将会将Drivers文件夹中所有内容复制到Web项目的目录下面。
    如果启动项目是Web项目,并且当前项目就是启动项目,T4模版不会有复制操作。
    如果启动项目是非Web项目,并且当前项目不是启动项目,T4模版会将会将Drivers文件夹中所有内容复制到非Web项目的bin\Debug目录下面。
    如果启动项目是非Web项目,并且当前项目就是启动项目,T4模版会将会将Drivers文件夹中所有内容复制到非Web项目的bin\Debug目录下面。

驱动dll
    在Drivers文件夹中的dll的名字不允许修改,否则会引起异常。
    DataVeryLite.dll为DataVeryLite项目驱动,整个开发过程中,你只需要引用这个dll即可。
    IBM.Data.DB2.dll为Db2的驱动。
    MySql.Data.dll为MySql的驱动。
    System.Data.SQLite.dll为Sqlite的驱动。
    Npgsql.dll和Mono.Security.dll为PostgreSql的驱动。
    Oracle,Sqlserver和Access采用.net自带驱动。
    其中Oracle和Db2需要下载并安装对应的客户端。

连接字符串
    在App.config或Web.config的connectionStrings节点中,添加连接字符串。
    例如:
    <add name="sqlite" connectionString="Data Source=dbs\Localite.db;Version=3;" providerName="sqlite"/>
    你必须提供providerName属性,否则会报异常。
    providerName的值必须是DataVeryLite指定的,具体的值见下面的表格。
     

数据库 连接字符串示例 providerName
Sqlite Data Source=dbs\Localite.db;Version=3; sqlite
Access Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\LocalAccess.mdb access
MySql server = localhost; user id = root; password = 123456; database = datawarehouse; mysql
PostgreSql Server=localhost;User Id=admin;Password=admin;Database=MyDb; postgresql
SqlServer Data Source=.;Initial Catalog=DandelionExt;Integrated Security=True sqlserver
Db2 Database=SAMPLE;User ID=db2admin;Server=192.168.40.128;password=123456 db2
Oracle Data Source=XE;User Id=HR;Password=VBshuqizhao12; oracle


命名规范
     通过T4模版生成的代码的namespace为当前项目default namesapce.Models.your db name。生成的实体类的名字以及属性的名字和数据库中的大小写对应。

构建你自己的项目
    1,将Drivers和Models文件夹复制到你的当前项目的目录,并包含在你的项目中。
    2,为启动项目新建App.config和Web.config(如果存在则不需要),并在节点connectionStrings中添加连接字符串。
    3,执行Model.tt模版。

查询

单值查询
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       //通过主键查询
       var p=Models.Localite.Person();
       p.Load(1);
      //获取表记录数
       int count=Models.Localite.Person.Count();
   }
}
集合查询
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var lo = new Models.Localite.Localite();
       //你可以查询任何你想要的,sql语句可以是任意的
       //persons是运行时检查的
       List<dynamic> persons = lo.List("select * from  Person");
       //查询所有
       List<Models.Localite.Person> persons1 = lo.ListAll<Models.Localite.Person>();
       //bettween查询
 List<Models.Localite.Person> persons2 = lo.ListByBetween<Models.Localite.Person>(1, 10);
       //top查询
       List<Models.Localite.Person> persons3 = lo.ListByTop<Models.Localite.Person>(10);
       //分页查询
 List<Models.Localite.Person> persons4 = lo.ListByPage<Models.Localite.Person>(1, 10);
       //通过sql语句查询
 List<Models.Localite.Person> persons5= lo.ListBySql<TEntity>("select * from Person");
      //查询所有,使用排序
       List<Models.Localite.Person> persons6 = lo.ListAll<Models.Localite.Person>(false);
   }
}

插入

单条插入
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       //主键自增
       var p=Models.Localite.Person();
       p.Name="p";
       p.Save();
       //主键不自增
       var p1=Models.Localite.Person();
       p1.Id=1;
       p1.Name="p1";
       p1.Save(false);
   }
}
批量插入
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var lo = new Models.Localite.Localite();
       Models.Localite.Person p1 = new Models.Localite.Person();
       Models.Localite.Person p2 = new Models.Localite.Person();
       p2.Name = "p2n";
       //第一种方式
       lo.Save(p1, p2);
       List<Models.Localite.Person> list=new List<Models.Localite.Person>();
       list.add(p1);
       list.add(p2);
       //第二种方式
       lo.Save(list);
   }
}

修改

单条修改
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var p=Models.Localite.Person();
       p.Id=1;
       p.Name="p";
       p.Update();
   }
}
批量修改
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var lo = new Models.Localite.Localite();
       Models.Localite.Person p1 = new Models.Localite.Person();
       Models.Localite.Person p2 = new Models.Localite.Person();
       p2.Id=1;
       p2.Name = "p2n";
       //第一种方式
       lo.Update(p1, p2);
       List<Models.Localite.Person> list=new List<Models.Localite.Person>();
       list.add(p1);
       list.add(p2);
       //第二种方式
       lo.Update(list);
   }
}

删除

单条删除
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var p=Models.Localite.Person();
       p.Id=1;
       p.Name="p";
       p.Del();
   }
}
批量删除
using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var lo = new Models.Localite.Localite();
       Models.Localite.Person p1 = new Models.Localite.Person();
       Models.Localite.Person p2 = new Models.Localite.Person();
       p2.Id=1;
       p2.Name = "p2n";
       //第一种方式
       lo.Del(p1, p2);
       List<Models.Localite.Person> list=new List<Models.Localite.Person>();
       list.add(p1);
       list.add(p2);
       //第二种方式
       lo.Del(list);
   }
}

原生sql

using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
        Models.Localite.Localite.NativeSql.ExecuteNonQuery(...);
        Models.Localite.Localite.NativeSql.ExecuteScalar(...);
        Models.Localite.Localite.NativeSql.ExecuteReader(...);
        Models.Localite.Localite.NativeSql.ExecuteDataSet(...);
        //与lo.List("select * from  Person") 类似
        Models.Localite.Localite.NativeSql.ExecuteDynamic(...);
   }
}

使用事物

using System;
public class HelloWorld
{
   public static void Main(params string[] args)
   {
       var lo = new Models.Localite.Localite();
       DbTransaction tran = lo.BeginTransaction();
       try{
           var lo = new Models.Localite.Localite();
            Models.Localite.Person p1 = new Models.Localite.Person();
            Models.Localite.Person p2 = new Models.Localite.Person();
            p2.Id=1;
            p2.Name = "p2n";
            p1.Save(tran);
            lo.Del(tran,p1, p2);
            lo.Update(tran,p1,p2);
            lo.Commit();
       }catch{
         lo.Rollback();
       }
   }
}

DataVeryLite.Base.Entity

public virtual Entity Load(object,DbTransaction)
    Load,通过主键值加载实体类.
        /// <summary>
        /// Load data for this entity
        /// </summary>
        /// <param name="idValue">A id value in your table,suppurt long,int & short etc...</param>
        /// <param name="trans">Transaction</param>
        /// <returns></returns>

public virtual Entity LoadBySql(string,DbTransaction,CommandType,params DbParameter[])
    LoadBySql,通过Sql加载实体类.
        /// <summary>
        /// Load data for this entity by any sql text,can use transaction
        /// </summary>
        /// <param name="cmdText">Any sql text</param>
        /// <param name="trans">Transaction</param>
        /// <param name="cmdType">Sql text type</param>
        /// <param name="cmdParms">Parameter</param>
        /// <returns></returns>

public virtual Entity LoadBySql(string,CommandType,params DbParameter[])
     LoadBySql,通过Sql加载实体类.
        /// <summary>
        /// Load data for this entity by any sql text
        /// </summary>
        /// <param name="cmdText">Any sql text</param>
        /// <param name="cmdType">Sql text type</param>
        /// <param name="cmdParms">Parameter</param>
        /// <returns></returns>

public virtual void Del(DbTransaction)
      Del,删除记录.
        /// <summary>
        /// Delete record from database
        /// </summary>
        ///<param name="transaction">Transaction</param>

public virtual void Update(DbTransaction)
      Update,更新记录.
        /// <summary>
        /// Update record to database
        /// </summary>
        /// <param name="transaction">Transaction</param>

public virtual void Save(bool,DbTransaction)
      Save,保存记录.
        /// <summary>
        /// Insert entity to database
        /// </summary>
        /// <param name="isIdAutoGrow">Id is or isn't auto grow </param>
        /// <param name="transaction">Transaction</param>

public virtual void Save(DbTransaction)
      Save,保存记录.
        /// <summary>
        /// Insert entity to database,isIdAutoGrow = true
        /// </summary>
        /// <param name="transaction">Transaction</param>

public static int Count
      Count,表的总行数.
        /// <summary>
        /// Table record count
        /// </summary>

DataVeryLite.Base.EntityPool

public virtual List<dynamic> List(string,DbTransaction) ListBySql<T>(string,DbTransaction,CommandType,params DbParameter)">
      ListBySql,通过sql获取集合数据.
        /// <summary>
        /// Load data  list by any sql text,can use transaction
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="cmdText">Any sql text</param>
        /// <param name="trans">Transaction</param>
        /// <param name="cmdType">Sql text type</param>
        /// <param name="cmdParms">Parameter</param>
        /// <returns></returns>

public virtual List<T> ListBySql<T>(string,CommandType,params DbParameter[]) ListAll<T>(bool,DbTransaction)">
      ListAll,执行后获取所有记录.
        /// <summary>
        ///  Load all data
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="asc">Order by</param>
        /// <param name="trans">Transaction</param>
        /// <returns></returns>

public virtual List<T> ListByTop<T>(int,bool,DbTransaction) ListByPage<T>(int,int,bool,DbTransaction)">
      ListByPage,通过Page获取记录.
        /// <summary>
        /// Load data page
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="page">Page value</param>
        /// <param name="pageSize">Page size</param>
        /// <param name="asc">Order by</param>
        /// <param name="trans">Transaction</param>
        /// <returns></returns>

public virtual List<T> ListByBetween<T>(int,int,bool,DbTransaction)(List<T>,DbTransaction)">
      Del,执行后批量删除记录.
        /// <summary>
        /// Betch delete
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="list">Entity list</param>
        /// <param name="trans">Transaction</param>

public virtual void Del<T>(DbTransaction,params T[])(params T)">
      Del,执行后批量删除记录.
        /// <summary>
        /// Betch delete
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="arr">Entity params</param>

public virtual void Update<T>(List<T>,DbTransaction)(DbTransaction trans,params T)">
      Update,执行后批量修改记录.
        /// <summary>
        /// Betch update
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="trans">Transaction</param>
        /// <param name="arr">Entity params</param>

public virtual void Update<T>(params T[])(List<T>,bool,DbTransaction)">
      Save,执行后批量保存记录,并返回自增Id值.
        /// <summary>
        /// Betch insert
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="list">Entity list</param>
        /// <param name="isIdAutoGrow">Is id auto grow?</param>
        /// <param name="trans">Transaction</param>

public virtual void Save<T>(DbTransaction,params T[])(DbTransaction,List<T>)">
      Save,执行后批量保存记录,并返回自增Id值.
        /// <summary>
        /// Betch insert,isIdAutoGrow = true
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="trans">Transaction</param>
        /// <param name="list">Entity list</param>

public virtual void Save<T>(params T[])(bool,params T)">
      Save,执行后批量保存记录,并返回自增Id值.
        /// <summary>
        /// Betch insert
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="isIdAutoGrow">Is id auto grow?</param>
        /// <param name="arr">Entity params</param>

public virtual void Save<T>(bool,DbTransaction,params T[])(List<T>,bool,DbTransaction)">
      SaveOnly,执行后批量保存记录.
        /// <summary>
        /// Betch insert,don't return id value
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="isIdAutoGrow">Is id auto grow?</param>
        /// <param name="list">Entity list</param>

public virtual void SaveOnly<T>(DbTransaction,params T[])(DbTransaction,List<T>)">
      SaveOnly,执行后批量保存记录.
        /// <summary>
        /// Betch insert,isIdAutoGrow = true,don't return id value
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="trans">Transaction</param>
        /// <param name="list">Entity list</param>

public virtual void SaveOnly<T>(bool,DbTransaction,params T[])(params T)">
       SaveOnly,执行后批量保存记录.
        /// <summary>
        /// Betch insert,isIdAutoGrow = true,don't return id value
        /// </summary>
        /// <typeparam name="T">Entity</typeparam>
        /// <param name="arr">Entity params</param>

public virtual void SaveOnly<T>(bool,params T[])
      BeginTransaction,执行后开始事物.
        /// <summary>
        /// Start transaction
        /// </summary>
        /// <param name="isolationLevel">transaction level</param>
        /// <returns></returns>

public virtual void Commit()
      Commit,执行后提交事物.
        /// <summary>
        /// Commit transaction
        /// </summary>

public virtual void Rollback()
      Rollback,执行后回滚事物.
        /// <summary>
        /// Rollback transaction
        /// </summary>

DataVeryLite.Util.SqlHelper

   SqlHelper提供执行所有原生sql的能力,主要方法提供对DbCommand方法的封装,使其使用简单方便。

public SqlHelper(string dbConnectionString, string providerName,string driverPath)
    SqlHelper构造方法,通过连接字符串,数据库提供名,驱动所在路径初始化
        /// <summary>
        /// Sql CRUD provider and helper
        /// </summary>
        /// <param name="dbConnectionString">ConnectionString</param>
        /// <param name="providerName">ConnectionString provider name in config</param>
        /// <param name="driverPath">Your driver path,the default path is strat up dir</param>

public SqlHelper(string key, string driverPath = null)
    SqlHelper构造方法,通过配置文件中的ConnectionString节点初始化
        /// <summary>
        /// Sql CRUD provider and helper
        /// </summary>
        /// <param name="key">ConnectionString key in config</param>
        /// <param name="driverPath">Your driver path,the default path is strat up dir</param>

public int ExecuteNonQuery(string,string,CommandType,params DbParameter[])
    ExecuteNonQuery,执行后返回受影响的行数.
        /// <summary>
        /// Return the affected rows 
        /// </summary>
        /// <param name="connectionString">Connection String</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The affected rows </returns>

public int ExecuteNonQuery(string,CommandType, params DbParameter[])
    ExecuteNonQuery,执行后返回受影响的行数.在DataVeryLite项目中推荐该方法.
        /// <summary>
        /// Return the affected rows
        /// </summary>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The affected rows</returns>

public int ExecuteNonQuery(DbConnection,string,CommandType,params DbParameter[])
    ExecuteNonQuery,执行后返回受影响的行数.
        /// <summary>
        /// Return the affected rows
        /// </summary>
        /// <param name="conn">DbConnection</param>
        /// <param name="cmdText">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdType">DbParameter</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The affected rows</returns>

public int ExecuteNonQuery(DbTransaction,string,CommandType,params DbParameter[])
     ExecuteNonQuery,执行后返回受影响的行数.
        /// <summary>
        /// Return the affected rows
        /// </summary>
        /// <param name="trans">DbTransaction</param>
        /// <param name="cmdText">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdType">DbParameter</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The affected rows</returns>

public object ExecuteScalar(string,string,CommandType,params DbParameter[])
     ExecuteScalar,执行后返回一个单个值.
        /// <summary>
        /// Return the single value
        /// </summary>
        /// <param name="connectionString">Connection String</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The single value</returns>

public object ExecuteScalar(string,CommandType,params DbParameter[])
     ExecuteScalar,执行后返回一个单个值.在DataVeryLite项目中推荐该方法.
        /// <summary>
        /// Return the single value
        /// </summary>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The single value</returns>

public object ExecuteScalar(DbConnection,string,CommandType,params DbParameter[])
     ExecuteScalar,执行后返回一个单个值.
        /// <summary>
        /// Return the single value
        /// </summary>
        /// <param name="conn">DbConnection</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The single value</returns>

public object ExecuteScalar(DbTransaction,string,CommandType,params DbParameter[])
     ExecuteScalar,执行后返回一个单个值.
        /// <summary>
        /// Return the single value
        /// </summary>
        /// <param name="trans">DbTransaction</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The single value</returns>

public DbDataReader ExecuteReader(string,string,CommandType,params DbParameter[])
     ExecuteReader,执行后返回DataReader.
        /// <summary>
        /// Return the DataReader
        /// </summary>
        /// <param name="connectionString">Connection String</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataReader</returns>

public DbDataReader ExecuteReader(string,CommandType,params DbParameter[])
      ExecuteReader,执行后返回DataReader.在DataVeryLite项目中推荐该方法.
        /// <summary>
        /// Return the DataReader
        /// </summary>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataReader</returns>

public DbDataReader ExecuteReader(DbConnection,string,CommandType,params DbParameter[])
      ExecuteReader,执行后返回DataReader.
        /// <summary>
        /// Return the DataReader
        /// </summary>
        /// <param name="conn">DbConnection</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataReader</returns>

public DbDataReader ExecuteReader(DbTransaction,string,CommandType,params DbParameter[])
      ExecuteReader,执行后返回DataReader.
        /// <summary>
        /// Return the DataReader
        /// </summary>
        /// <param name="trans">DbTransaction</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataReader</returns>

public DataSet ExecuteDataSet(string,string,CommandType,params DbParameter[])
      ExecuteDataSet,执行后返回DataSet.
        /// <summary>
        /// Return the DataSet
        /// </summary>
        /// <param name="connectionString">Connection String</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataSet</returns>

public DataSet ExecuteDataSet(string,CommandType, params DbParameter[])
      ExecuteDataSet,执行后返回DataSet.在DataVeryLite项目中推荐该方法.
        /// <summary>
        /// Return the DataSet
        /// </summary>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataSet</returns>

public DbDataReader ExecuteReader(DbConnection,string,CommandType,params DbParameter[])
      ExecuteDataSet,执行后返回DataSet.
        /// <summary>
        /// Return the DataSet
        /// </summary>
        /// <param name="conn">DbConnection</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>The DataSet</returns>

public DataSet ExecuteDataSet(DbTransaction,string,CommandType,params DbParameter[])
      ExecuteDataSet,执行后返回DataSet.
        /// <summary>
        /// Return the DataSet
        /// </summary>
        /// <param name="trans">DbTransaction</param>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns></returns>

public List<dynamic> ExecuteDynamic(string,DbTransaction,CommandType,params DbParameter[]) ExecuteDynamic(string,CommandType,params DbParameter)">
      ExecuteDynamic,执行后返回任何你想要的
        /// <summary>
        /// Return anything you want
        /// </summary>
        /// <param name="cmdText">Sql</param>
        /// <param name="cmdType">CommandType,default value is CommandType.Text</param>
        /// <param name="cmdParms">DbParameter</param>
        /// <returns>Anything you want</returns>

Last edited Jun 30, 2013 at 5:21 AM by shuqizhao, version 3

Comments

No comments yet.