存储过程和放大器; LINQ,Dmbl文件无法跨preT结果集 [英] Stored Procedure & LINQ, Dmbl File unable to interpret the result set

查看:116
本文介绍了存储过程和放大器; LINQ,Dmbl文件无法跨preT结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个存储过程,当添加到我的dbml,似乎幕后LINQ不能跨preT的结果集,并会简单地映射的结果作为一个int。然后,我要创建自己的结果类,它是一种痛苦,但我也得去,每次我添加到我的dbml更改设计文件,因为它会重新加载它,并将结果映射回一个int每个那些存储过程。

I have several Stored Procedures that when added to my dbml, it seems that behind the scenes LINQ can not interpret the result set and will simply map the result as an int. I then have to create the result class myself which is a pain but also I have to go and change the designer file every time I add to my dbml because it will re-load it and map the result back to an int for each of those stored procedures.

这与我的存储过程是一个问题,LINQ不能跨preT,然后创建结果类我。或者,这是LINQ的问题吗?

Is this a problem with my Stored procedures that LINQ can't interpret and then create the the result class for me. Or is this a problem with LINQ?

推荐答案

你在你的存储过程使用临时表?引起的问题(该问题实际上SQL的)。这里有一个博客文章它,解决办法是更换临时存储过程而添加存储过程到DBML。

Do you use a temporary table in your sproc? That causes a problem (the problem is actually SQL's). Here's a blog post about it, solution is to replace the sproc temporarily while adding the sproc to the DBML.

不幸的是,我不认为这是一个更好的解决办法...

Unfortunately I don't think there is a better solution...

编辑:<一href="http://stackoverflow.com/questions/496195/how-do-i-get-linq-to-sql-to-recognize-the-result-set-of-a-dynamic-stored-procedur">Here是别人同样的问题,和稍微不同的解决方案。

Here is someone else with the same problem, and a slightly different solution.

再次编辑:这里是一个更好的解释和解决方案,不涉及更换时,你所做的存储过程;它包括额外的code在存储过程来检测何时FMTONLY已设置并暂时禁用它。不错的主意,我可能会尝试在未来。

EDIT AGAIN: Here is a much better explanation and a solution that doesn't involve replacing the sproc when your done; It does include additional code in the sproc to detect when FMTONLY has been set and temporarily disable it. Neat idea, I may try it in the future.

这篇关于存储过程和放大器; LINQ,Dmbl文件无法跨preT结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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