开发者

combine multiple DataViews into a single one?

开发者 https://www.devze.com 2022-12-21 17:14 出处:网络
I have 4 different select statements which i sequently assign to an sqlDataSource like this: sqlNoutatiProduse.SelectCommand = select;

I have 4 different select statements which i sequently assign to an sqlDataSource like this:

sqlNoutatiProduse.SelectCommand = select;

and i keep the results in different DataViews like

MySession.Current.d开发者_JAVA百科ataViewNoutatiProduse1 = (System.Data.DataView)sqlNoutatiProduse.Select(DataSourceSelectArguments.Empty);

and so on.

Is it possible to combine into a single DataView the results of these queries?


Without more details, this is the best generic answer I can give...

It's possible to create a DataTable manually, add the columns you need, and then loop through the DataViews to add records to your new table. I've used this technique where I can't do the work at the DB level. However, this would be horribly inefficient.

You'd be better off seeing if you can get the data you want it directly from the DB.

0

精彩评论

暂无评论...
验证码 换一张
取 消