private void FillListview_n(ListView lv, string sql)
{
lv.Items.Clear();
DataSet ds = new DataSet();
ds = Program.fax.GetDatSet(sql, Program.ip);
if (ds != null)
{
string[] str = new string[ds.Tables[0].Columns.Count];
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
str[j] = ds.Tables[0].Rows[i][j].ToString();
ListViewItem item = new ListViewItem(str, 0);
lv.Items.Add(item);
}
}
}
listview的列头在向导中定义
dt = money.getAll2();
不明白你这个dt是从哪儿来得.
应该
DataTable dt=new DataTable();
dt=money.getAll2();