System.Windows.Forms.ListView 如何设置数据绑定啊? ListView只能自己一项一项地加啊..当然你自己可以写一个通用点的方法来适合自己的应用. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ListView 真的不能绑定数据啊? private void LdData_Load(object sender, System.EventArgs e) { try { OleDbConnection mycon = new OleDbConnection(cnn); mycon.Open(); OleDbdapt = new OleDbDataAdapter(strSql,mycon); dsT = new DataSet(); OleDbdapt.Fill(dsT,"ld"); Cmd= new OleDbCommandBuilder(OleDbdapt); for(int i=0;i<dsT.Tables["ld"].Rows.Count;i++) { listView1.Items.Add(dsT.Tables["ld"].Rows[i]["ld_name"].ToString()); } this.dataGrid1.DataSource = this.dsT; this.dataGrid1.DataMember = "ld"; mycon.Close(); } catch ( Exception ed ) { MessageBox.Show ( "错误信息: " + ed.ToString ( ) , " 测试系统",MessageBoxButtons.OK,MessageBoxIcon.Information ) ; } 求教chart数据过多如何解决? WPF datagrid计算列 C#中使用Socket发送UDP数据包问题,请指教 如何取得一种文件的默认打开方式? 急求!正则表达式 !急求 无分跪求!那位给个.Net C#项目的源码下载? [C#]我真是笨透了,该怎样把C:\\aaa\\bbb\\a.txt的路径名和文件名分开 急........udp监听本机端口的问题.............. C#访问Sybase,传命名参数怎么有问题? StreamWrite 写入TXT文件时,好像有一个行数上限,总是不能写全,请高手指教 Grid不可编辑-->可编辑。 可以用c#复制一个数据库的结构么??
{
try
{ OleDbConnection mycon = new OleDbConnection(cnn);
mycon.Open();
OleDbdapt = new OleDbDataAdapter(strSql,mycon);
dsT = new DataSet();
OleDbdapt.Fill(dsT,"ld");
Cmd= new OleDbCommandBuilder(OleDbdapt);
for(int i=0;i<dsT.Tables["ld"].Rows.Count;i++)
{
listView1.Items.Add(dsT.Tables["ld"].Rows[i]["ld_name"].ToString());
}
this.dataGrid1.DataSource = this.dsT;
this.dataGrid1.DataMember = "ld";
mycon.Close();
}
catch ( Exception ed )
{
MessageBox.Show ( "错误信息: " + ed.ToString ( ) , " 测试系统",MessageBoxButtons.OK,MessageBoxIcon.Information ) ;
}