在一个窗体中查询的数据如何在另一个窗体中的datagridview中显示

是用C#调用ACCESS,来实现的,代码怎么写

可在第二窗体中建立 public dataSet 对象;
在第一窗体查询的结果保存到 dataSet 对象中。创建第二窗体对象。
第二窗体对象名。dataSet 对象名 = 第一窗体dataSet 对象名。

然后在第二窗体中将dataSet 对象填充到datagridview中显示。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-07-26
你传条件过去
比如 你在A窗体查询数据产生的条件字符为:where 1=1 and colum1="str1" and colum2="str2".....
把这个字符串“and colum1="str1" and colum2="str2".....”穿过B窗体

在B窗体加载的时候判断 如果不为空 则 对datagridview 实行数据绑定 条件就是刚才那个
第2个回答  2009-07-28
1.建好bindingSource数据源
Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Documents and Settings\Administrator\桌面\Database1.mdb"
2.指定datagridview的datasource为bindingSource
相似回答