class Program
{
static void Main(string[] args)
{
DataTable DT = new DataTable();
//数据产生过程
..........
DataView DV = DT.DefaultView ;
DV.Sort = "Item,line,sequence";
int i, j;
for (i = 0; i < DV.Count - 1; i++)
{
if (DV[i]["Item"] == DV[i + 1]["Item"] && DV[i]["line"] == DV[i + 1]["line"])
{
for (j = (int)DV[i]["sequence"] + 1; j < (int)DV[i + 1]["sequence"] ; j++)
{
Console.WriteLine(DV[i]["Item"] + " || "+DV[i]["line"] +" || " + j.ToString());
}
}
}
}
}
{
static void Main(string[] args)
{
DataTable DT = new DataTable();
//数据产生过程
..........
DataView DV = DT.DefaultView ;
DV.Sort = "Item,line,sequence";
int i, j;
for (i = 0; i < DV.Count - 1; i++)
{
if (DV[i]["Item"] == DV[i + 1]["Item"] && DV[i]["line"] == DV[i + 1]["line"])
{
for (j = (int)DV[i]["sequence"] + 1; j < (int)DV[i + 1]["sequence"] ; j++)
{
Console.WriteLine(DV[i]["Item"] + " || "+DV[i]["line"] +" || " + j.ToString());
}
}
}
}
}