ArrayList myArrayList = new ArrayList();
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
for (int j = 0; j <= dt.Columns.Count - 1; j++)
{
myArrayList.Add(dt.Rows[i][j].ToString());
}
}
我想向所有要存储在数组列表中的邮件ID发送邮件。如何将总数组列表绑定到Textbox
。
如果我正确理解了您的问题,则此代码可以为您提供帮助
foreach(object item in myArrayList)
{
TextBoxId.Text += item.ToString();
}
或者您可以忘记arrayList,直接在表中循环时填充TextBox。
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
for (int j = 0; j <= dt.Columns.Count - 1; j++)
{
//myArrayList.Add(dt.Rows[i][j].ToString());
TextBoxId.Text += dt.Rows[i][j].ToString();
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句