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 ) ; } 在打开对话框中选择了所需的图片,如何让其显示出来啦? c# 窗体的发展方向? Vista下Datetimepicker显示乱码,求解 急,存储过程输出参数问题?? 求C#打开文件原码 100分相送!请问c#里对只读属性应该怎么修改值啊? 页面加载是如何对其中的控件进行操作 怎样将DataTable里的对象元素组装回来,放到ArrayList里成其元素?? 我有一个ASCII文件,用StreamReader读取一行 "Namespace 名字空间" 是什么意思 ? 通俗点的 。 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 ) ;
}