SqlHelperExecuteProcedureAsync(String, Object) Method
異步執行預存程序並取得影響筆數
Namespace: eBizprise.FrameworkAssembly: eBizprise.Framework.Database.SqlHelper (in eBizprise.Framework.Database.SqlHelper.dll) Version: 25.0.2.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public Task<DatabaseResult<int>> ExecuteProcedureAsync(
string procedureName,
Object parameter
)
- procedureName String
- 預存程序
- parameter Object
- 參數
TaskDatabaseResultInt32DatabaseResult<int>
帶入參數名稱需與查詢式中參數名稱大小寫一致;『@』符號僅查詢式中參數名稱需前輟
using (SqlHelper sqlHelper = new SqlHelper("SqlServer"))
{
DatabaseResult<int> result = sqlHelper.ExecuteProcedure("sp_rename", new { objname = "Employee.EmployeeNo", newname = "UserNo", objtype = "COLUMN" });
if (result.IsSuccess) {
int effectRow = result.Result;
//Do something
} else {
Exception exception = result.Exception;
//Error handling
}
}
| Date | Version | Description |
|---|
| 2020/09/28 | 1.0.21.0 | 增加異步處理機制 |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |