日期:2014-05-19  浏览次数:20921 次

用dataset和bindingsource绑定了数据库后,如何提取里表的记录?
用dataset和bindingsource绑定了数据库后,如何提取里表的记录?
有没有代码演示?

------解决方案--------------------
生成数据集,填充表2的数据到数据集,然后把数据集绑定到bindingsource,过程和以前一样。不过中间加了个bindingsource
------解决方案--------------------

dataset ds = bindingsource.datasource as dataset(or other)
------解决方案--------------------
不知道是不是你想要的?

this.bindingSource1.DataSource=ds.Tables[2];
this.dataGridView1.DataSource = this.bindingSource1;