我收到上述错误,并无法加以解决。 我GOOGLE了一下,但无法摆脱它。
I am getting the above error and unable to resolve it. I googled a bit but can't get rid of it.
方案:
我有类BudgetAllocate其财产被预算是double类型的。
I have class BudgetAllocate whose property is budget which is of double type.
在我dataAccessLayer,
In my dataAccessLayer,
在我的课,我想这样做的一个:
In one of my classes I am trying to do this:
double.TryParse(objReader[i].ToString(), out bd.Budget);
这是引发此错误:
Which is throwing this error:
属性或索引可能无法通过为out或ref参数 编译时间。
Property or indexer may not be passed as an out or ref parameter at compile time.
我甚至尝试这样的:
double.TryParse(objReader[i].ToString().Equals(DBNull.Value) ? "" : objReader[i].ToString(), out bd.Budget);
其他一切工作正常与层之间的引用是present。
Everything else is working fine and references between layers are present.
您无法使用
double.TryParse(objReader[i].ToString(), out bd.Budget);
一些变量替换bd.Budget。
replace bd.Budget with some variable.
double k;
double.TryParse(objReader[i].ToString(), out k);