如何在运行时动态加入两个表在Linq To Sql ...? [英] How Can I Join Two Tables Dynamically At Runtime In Linq To Sql...?

查看:64
本文介绍了如何在运行时动态加入两个表在Linq To Sql ...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景就像,我的客户端可以从数据库和列名中选择任何表!!!

所以我主要关注的是如何动态加入所选的表名...我试过使用用于动态WHERE CLAUSE和SELECT CLAUSE的Scott.Linq.Dynamic模型解决了半场景,但我找到了JOIN方法的任何自定义。

The scenario is like , My client can select any table from database and the column names !!!
so my main concern is how can i join the selected table names dynamically .. i tried using System.Linq.Dynamic model of Scott Gu for dynamic WHERE CLAUSE AND SELECT CLAUSE which solved the half scenario , but i dint find any customization for JOIN method.

推荐答案

Refer这个,



http://social.msdn.microsoft.com/Forums/en-US/fdba5462-bfc4-4c2c-848f-f5eb6bebc384/dynamically-query-across-multiple-tables [ ^ ]



一切顺利:)
Refer this,

http://social.msdn.microsoft.com/Forums/en-US/fdba5462-bfc4-4c2c-848f-f5eb6bebc384/dynamically-query-across-multiple-tables[^]

All the best:)


哦谢谢Karthy一定会看看这个


感谢队友!!
ohh thanks Karthy will sure look into this

thanks mate !!


这篇关于如何在运行时动态加入两个表在Linq To Sql ...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆