Winform绑定数据源的几种方式?
2024-10-16 04:39:49
第一种:
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>);
最新文章
- curl常用选项详解
- windows上安装numpy,scipy
- oprofile 安装使用
- 6/3 Sprint2 看板和燃尽图
- online learning
- codeforces #313 div1 A
- C#数据采集类
- 在Laravel5.* 中使用 AdminLTE
- centos 64bit 安装与升级 chrome的方法
- IE6-能让png图片有透明效果的js代码
- spring4 之 helloworld
- JS函数参数
- WinRAR代码执行漏洞CVE-2018-20250
- ra (数论 , 莫比乌斯反演 , 整点统计)
- mysql 案例 ~ 分析执行完的大事务
- Laravel 5.2 INSTALL- node&#39;s npm and ruby&#39;s bundler.
- cocos代码研究(2)Label学习笔记
- Tomcat 基本配置
- JavaScript hash
- (转)IE=EmulateIE7 标签的作用