gpt4 book ai didi

c# - 林奇 : The query results cannot be enumerated more than once

转载 作者:太空狗 更新时间:2023-10-29 22:04:11 25 4
gpt4 key购买 nike

<分区>

这是我的代码

 searchDataContext db = new searchDataContext();

var query = (from p in db.SearchFirst(city, area)
select new
{
ID = p.Id,
Address = p.address,
Level = p.agahilevel

});
int count =query.Count();

// records
var q = query.Skip(Convert.ToInt32(start)).Take(Convert.ToInt32(width));

if (q.Count() > 0)
{
int index = 0;
str += "[";
foreach (var row in q)
{
if (index == 0)

这段代码有错误

The query results cannot be enumerated more than once.

请检查并回答我。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com