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

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>();
}

}

posted @ 2017-05-08 16:59  大善若龙  阅读(1550)  评论(0编辑  收藏  举报