惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
J
Java Code Geeks
I
InfoQ
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
V
Visual Studio Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
有赞技术团队
有赞技术团队
月光博客
月光博客
Martin Fowler
Martin Fowler
量子位
L
LangChain Blog
B
Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

博客园 - zfh424

Ext自定义类 JavaScript中匿名函数,函数直接量和闭包(转) Extjs3.0 Javascript小助手 DOM标准定位 HTML 对象的定位. EXTJS2.2 FormPane对象研究 EXTJS-Grid HTML事件集合 DOM属性,函数 Windwos服务的安装卸载 枚举 C#类型 C#可空类型 c#基础 开始记录我的追逐历程 Eds 模拟窗体 js 游戏 POP的使用组件
使用企业库调用存储过程,并接受return 的返回值
zfh424 · 2009-02-03 · via 博客园 - zfh424

String sql = "moveData";
mCMD = DB.GetStoredProcCommand(sql);
DB.AddInParameter(mCMD,"@State",DbType.Int32,2);
DB.AddParameter(mCMD, "@ret", DbType.Byte, ParameterDirection.ReturnValue,"",DataRowVersion.Default,null);

mCMD.Parameters["@ret"].Value

1.添加参数

public void AddParameter(DbCommand command, string name, DbType dbType, ParameterDirection direction, string sourceColumn, DataRowVersion sourceVersion, object value);

    DB.AddParameter(mCMD, "@return", DbType.Byte, ParameterDirection.ReturnValue,"",DataRowVersion.Default,null);

DB.AddParameter(mCMD, "@return", DbType.Byte, ParameterDirection.ReturnValue,NULL,DataRowVersion.Default,null);

说明:第二个为参数名必须为 @变量名 否则系统会自动添加

        ParameterDirection.ReturnValue    最关键指明去传回值

2.执行

    DB.ExecuteNonQuery(mCMD);

3.取值

  DbType.Byte x= mCMD.Parameters["@return"].Value;