首页 > Windows开发 > 详细

C# DataGridView绑定数据源

时间:2016-06-09 12:15:57      阅读:310      评论:0      收藏:0      [点我收藏+]

 

第一种:
DataSet ds=new DataSet (); 
this.dataGridView1.DataSource=ds.Table[0]; 

第二种:
DataTable   dt=new   DataTable(); 
this.dataGridView1.DataSource=dt; 
 
第三种:
DataSet ds=new DataSet (); 
this.dataGridView1.DataSource = ds.Tables["表名"]; 
 
第四种:
DataSet ds=new DataSet (); 
this.dataGridView1.DataSource = ds; 
this.dataGridView1.DataMember = "表名";
 
第五种:
ArrayList Al = new ArrayList();
this.dataGridView1.DataSource = Al; 
 
第六种:
Dictionary<string, string> dic = new Dictionary<string, string>(); 
this.dataGridView1.DataSource = dic; 
 
第七种:
DataView dv = new DataView();
this.dataGridView1.DataSource = dv;
 
第八种:
this.dataGridVi.DataSource = new BindingList<Object>(List<Object>);

 

C# DataGridView绑定数据源

原文:http://www.cnblogs.com/ficow/p/5572169.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!