相关疑难解决方法(0)

属性或索引器不能作为out或ref参数传递

我收到上述错误,无法解决.我google了一下,但无法摆脱它.

场景:

我有类BudgetAllocate,其属性是预算,是双重类型.

在我的dataAccessLayer中,

在我的一个课程中,我试图这样做:

double.TryParse(objReader[i].ToString(), out bd.Budget);
Run Code Online (Sandbox Code Playgroud)

这引发了这个错误:

在编译时,属性或索引器不能作为out或ref参数传递.

我甚至试过这个:

double.TryParse(objReader[i].ToString().Equals(DBNull.Value) ? "" : objReader[i].ToString(), out bd.Budget);
Run Code Online (Sandbox Code Playgroud)

其他一切工作正常,层之间的引用存在.

.net c# error-handling

73
推荐指数
6
解决办法
7万
查看次数

标签 统计

.net ×1

c# ×1

error-handling ×1