日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Enterprise Library 2.0 取得存儲過程的返回值

系統(tǒng) 2157 0
http://blog.csdn.net/hawkjin/archive/2007/05/25/1625271.aspx(轉(zhuǎn))

1.存儲過程

CREATE PROCEDURE p1 AS
return 1
GO

2.C#代碼

using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace Test
... {
public partial class _Default:System.Web.UI.Page
... {
protected void Page_Load( object sender,EventArgse)
... {
Databasedb
= DatabaseFactory.CreateDatabase();
string sqlCommand = " p1 " ;
DbCommanddbCommand
= db.GetStoredProcCommand(sqlCommand);
db.AddParameter(dbCommand,
" myReturnValue " ,DbType.Int32,ParameterDirection.ReturnValue, "" ,DataRowVersion.Current, null );
db.ExecuteNonQuery(dbCommand);
Response.Write(db.GetParameterValue(dbCommand,
" myReturnValue " ).ToString());

}

}

}


Enterprise Library 2.0 取得存儲過程的返回值


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 建始县| 句容市| 库车县| 偏关县| 商城县| 女性| 嘉祥县| 合川市| 岚皋县| 遂溪县| 广东省| 吴江市| 棋牌| 鱼台县| 泸州市| 商河县| 五常市| 桃园县| 武隆县| 永年县| 怀集县| 合阳县| 晋中市| 九江市| 杂多县| 松阳县| 张掖市| 彰武县| 江永县| 鹤庆县| 天柱县| 鄂伦春自治旗| 定西市| 阿巴嘎旗| 宁德市| 兴宁市| 获嘉县| 蚌埠市| 西盟| 湄潭县| 西华县|