分配问题求代码
数据库中第1-10到第1个仓库,第11-20到第2个仓库,共有n个仓库,要怎么写,求代码 --------------------编程问答-------------------- 类似查询分页??? --------------------编程问答-------------------- 差不多吧--------------------编程问答--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ch03
{
class Class1
{
static void Main(string[] args)
{
int[] temp = new int[100];
for (int i = 0; i < 100; i++)
{
temp[i] = i + 1;
}
int[] count = null;
SortedDictionary<string, int[]> sd = new SortedDictionary<string, int[]>();
for (int i = 0; i < temp.Length;)
{
count = new int[10];
for(int j = 0; j<10; j++)
{
count[j] = i;
i++;
}
int index = sd.Count +1;
sd.Add("第"+index+"个仓库",count);
Console.WriteLine("第" + index + "个仓库");
}
Console.WriteLine("_________________________");
for (int i = 1; i <= sd.Count; i++)
{
string name = "第"+i+"个仓库";
int[] index = sd[name];
for (int j = 0; j < index.Length; j++)
{
Console.WriteLine(name+ index[j]);
}
Console.WriteLine("_________________________");
}
}
}
}
补充:.NET技术 , ASP.NET