上一篇:CYQ.Data 轻量数据层之路 使用篇四曲 MAction 增删改(十五)

 

本篇内容概要

本篇继续上一篇内容,本节介绍MProc 类的相关操作。
1:MProc 存储过程操作
2:MProc SQL执行操作[
将于V1.5版本以上支持]

 

一:构造函数

方法原型:
public MProc(object procNamesEnum)
public MProc(object procName, string conn)

说明:

构造函数和MAction用法一致,相关操作可参数MAction。

示例1:

//传入存储过程名称 默认取配置项Conn的数据库链接
MProc proc = new MProc("GetUserList");
MProc proc 
= new MProc(ProcNames.GetUserList);//通过枚举传入

示例2:

//传入数据库新的数据库链接 配置项Conn
MProc proc = new MProc("GetUserList","ChatConn");
//传入数据库新的数据库链接 直接链接字符串
MProc proc = new MProc("GetUserList","Server=.;database=Chat;uid=sa;pwd=xxxxx");
//多数据库下用约定名称 取自ChatConn配置项的链接
MProc proc = new MProc(P_ChatEnum.GetUserList);

相关文章: