{
String sql="select * from studentinfo"
DataTable dt=DBhelper.CommonCha(sql)
//DBhelper是什么你知道吧?
foreach(DataRow dr in ds.Table[0].Rows)
{
ListViewItem first=new ListViewItem(dr["BookName"].ToString())
first.SubItems.Add(dr["Author"].ToString())
first.SubItems.Add(dr["Press"].ToString())
first.SubItems.Add(dr["PubDate"].ToString())
this.ListView1.Items.Add(first)
}
}
用[循环] INSERT ……for(i=0i<listview行数,i++)
{
insert into talbe (id,name)
values(listview的id和name列的值)
}
【注】
//取得listview某行某列的值
ListView1.Items.Item[1].SubItems.GetText)
listview1.Items[i].SubItems.strings[0]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)