遍历listBox里面的数据
for()
{
}
应该不难吧 得到listbox 的选择值 分别赋值 三个对应的字段 插入数据就OK了
int peopleCount = 第一个ListBox的ID.Items.Count;
int relativeCount = peopleCount;
string[] ziduan = new string[peopleCount];
string[] quanxian = new string[peopleCount];
string peopleName = "";
for(int iName =0;iName = peopleCount;iName ++)
{
peopleName = 第一个ListBox的ID.Items[iName].Value;
for(int iRelativeCount= 0;iRelativeCount < relativeCount;iRelativeCount++)
{
ziduan[iRelativeCount] = 第二个ListBox的ID.Items[iRelativeCount].Value;
quanxian[iRelativeCount] = 第三个ListBox的ID.Items[iRelativeCount].Value;
}
插入吧 参数是 peopleName ziduan quanxian
}
希望能帮到你!
foreach不是蛮好用的么。