SqlHelperExecuteProcedureScalarAsyncT(String) Method
異步執行預存程序並取得第1筆資料的第1個欄位值
Namespace: eBizprise.FrameworkAssembly: eBizprise.Framework.Database.SqlHelper (in eBizprise.Framework.Database.SqlHelper.dll) Version: 25.0.2.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public Task<DatabaseResult<T>> ExecuteProcedureScalarAsync<T>(
string procedureName
)
- procedureName String
- 預存程序
- T
TaskDatabaseResultTDatabaseResult<T>
using (SqlHelper sqlHelper = new SqlHelper("SqlServer"))
{
DatabaseResult<string> result = sqlHelper.ExecuteProcedureScalar<Guid>("sp_tables");
if (result.IsSuccess) {
string tableQualifier = 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年度初版 |