SqlHelperQuerySingleT(ExecuteType, String) Method
查詢唯一資料
using (SqlHelper sqlHelper = new SqlHelper("SqlServer"))
{
DatabaseResult<Employee> result = sqlHelper.QuerySingle<Employee>(ExecuteType.Text, sqlHelper.GetQueryString<Employee>() + " Where IneffectiveDate Is Null Or IneffectiveDate >= GetDate()");
if (result.IsSuccess) {
Employee employee = result.Result;
//Do something
} else {
Exception exception = result.Exception;
//Error handling
}
}
| Date | Version | Description |
|---|
| 2020/02/07 | 1.0.0.0 | 初版 |
| 2020/02/19 | 1.0.0.1 | 調整回傳格式包含執行成功與否以及異常訊息 |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |