Oracle sql语句 IN('a','b','c','dd')的上限是 1000个参数

本文介绍了一种通过循环和条件判断批量处理数据的方法,利用C#语言实现对大量数据的分批读取,并针对每一批数据进行特定操作如验证条形码是否重复。此方法适用于需要高效处理大量数据的应用场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

int total = dgList.RowCount;
int count = total / 500;
int num = total % 500;
if (num > 0)
{
count = count + 1;
}
for (int i = 0; i < count; i++)
{
DataRow dr = dgList.Rows[i].GetDataRow();

int cot = (i + 1) * 500;
if (cot <= total)
{
for (int j = (i * 500); j < cot; j++)
{
dr = dgList.Rows[j].GetDataRow();
listcode.Add(ValueHelper.GetValue<string>(dr["2)提单号码"]).Trim());
}
// 根据"ids" 调用服务端 如有返回ids的信息 表示已经存在
if (!queryBarcode(listcode))
{
//barcode_err.AddRange(responseCode.Listimports);
if (responseCode.Listimports != null)
{
responseCode.Listimports.ForEach(s =>
{
if (!check_barcodes.Keys.Contains(s))
{
check_barcodes.Add(s, "已录单");
}
});
}
}
listcode = new List<string>();
}
else
{
cot = total;
for (int j = (i * 500); j < cot; j++)
{
dr = dgList.Rows[j].GetDataRow();
listcode.Add(ValueHelper.GetValue<string>(dr["ids"]).Trim());
}
if (!queryBarcode(listcode))
{
if (responseCode.Listimports != null)
{
responseCode.Listimports.ForEach(s =>
{
if (!check_barcodes.Keys.Contains(s))
{
check_barcodes.Add(s, "已存在");
}
});
}
}
listcode = new List<string>();
}

}

转载于:https://www.cnblogs.com/dashanruolong/p/6825902.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值