实体框架调用FOR XML存储过程截断在2033字符
我有一个存储过程,它使用了一个FOR XML语句在它的结束,并返回我一些XML。
I have a stored procedure which uses a FOR XML statement at the end of it, and returns me some XML.
我使用.NET 4的实体框架,当我做这个存储过程的函数导入,并尝试通过实体框架称之为它截断了回报,在2033个字符。
I am using .NET 4 and the Entity Framework and when I do a function import of this stored procedure and try to call it through the Entity Framework it truncates the return at 2033 characters.
我换了实体框架的传统ADO.NET的方法来调用存储过程,它有同样的问题 - 截断为2033个字符 - 这是当我碰到下面的MSDN文章,解释这是由设计和使用该的ExecuteXmlReader的方法来克服它:
I swapped the Entity Framework for a traditional ADO.NET approach to call the stored procedure which had the same problem - truncated at 2033 characters - which is when I came across the following MSDN article explaining this is by-design and to use the "ExecuteXMLReader" method to overcome it:
http://support.microsoft.com/kb/310378
这就是现在的工作作为一个临时的解决办法,但我想使用实体框架功能的进口,所以我一直没有得到ADO.NET code混合了EF code。
So this is working now as a temporary fix but I'd like to use Entity Framework function imports so I've not got ADO.NET code mixed up with EF code.
有没有一些方法,我可以使用功能的进口EF,返回XML,克服了2033个字符的限制?
Is there some way I can use function imports in EF, return the XML and overcome the 2033 character limit?
问候
bgs264
Regards
bgs264
我碰到了同样的问题今天。
I ran into the same issue today.
在EF函数调用返回2033-长字符串的XML'块'(例如,如果你的XML是5000个字符多久,你会得到3个结果:2 2033个字符和1 934个字符)
The EF function call returns the XML in 2033-long string 'chunks' (e.g. if your XML was 5000 chars long you would receive 3 results: 2 of 2033 chars and 1 of 934 chars)
您可以轻松地添加这些块返回XML的完整列表。
You can easily append these chunks to return a full list of the XML.