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

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

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

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 取得存儲過程的返回值


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

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

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 山东省| 新巴尔虎右旗| 马关县| 安仁县| 乌兰浩特市| 留坝县| 东港市| 中山市| 天峨县| 南雄市| 南华县| 揭阳市| 高淳县| 新源县| 宁明县| 云梦县| 兴城市| 田东县| 大城县| 汤阴县| 如皋市| 岳阳市| 巍山| 宁化县| 许昌县| 石景山区| 封丘县| 丰城市| 普宁市| 仁怀市| 安多县| 合阳县| 金秀| 灵台县| 开鲁县| 同江市| 岱山县| 青龙| 台中市| 道真| 台湾省|