收益率返回和与数据库的连接

时间:2015-08-26 12:20:08

标签: c# .net yield-return

想象一下,您有以下代码:

hour   forgHour
0       1337.79 (the function should calculate this)
3       ...
3       ...
3      ...
4      ...
3      ...

然后在代码中的其他位置,您有以下内容:

select 
    student, sum(value)
from 
    payments
group by 
    student
having sum
   (case when Payment_type is not null then 1 else 0 end) = 0

是否意味着在foreach的所有执行期间(GetAllProducts()中的var p)与数据库的连接将保持打开状态?

0 个答案:

没有答案
相关问题