简体   繁体   English

LINQ 存储过程返回 integer 而不是结果

[英]LINQ stored procedure returns integer instead of results

I have a procedure in MS SQL Server and I am using LINQ to call it like this我在 MS SQL 服务器中有一个程序,我正在使用 LINQ 来这样称呼它

var history = dataContext.GetHistory("EA434144-BA34-480B-8A06-65CC7D405111", 
                System.DateTime.ParseExact("2011-05-30", @"yyyy-MM-dd", null));

When I was adding the procedure to visual studio it was saying that the return value cannot be detected.当我将程序添加到 Visual Studio 时,它说无法检测到返回值。 When calling, it was giving me design time error: cannot assign void to an implicitly typed local variable调用时,它给了我设计时错误:无法将 void 分配给隐式类型的局部变量

I tried to change the return value in visual studio and it can change it only to (None) but it lets me use the code now so it solves the "void" problem.我试图在 Visual Studio 中更改返回值,它只能将其更改为 (None),但它让我现在可以使用代码,因此它解决了“无效”问题。

MS SQL Server Management Studio says that the return value is intiger and i get 0 when i call the procedure with LINQ and i dont know how to get to the data that i want. MS SQL Server Management Studio 说返回值是整数,当我用 LINQ 调用程序时我得到 0,我不知道如何获取我想要的数据。 The result should be some list of double locations or NULL (its not just some SELECT query).结果应该是一些双重位置列表或NULL (它不仅仅是一些SELECT查询)。 When i call the procedure in management studio it shows the table with desired results but also again that the Return Value is 0.当我在管理工作室中调用该程序时,它会显示具有所需结果的表格,但也再次显示返回值为 0。

Where is the problem?问题出在哪里? Is it some LINQ feature?它是一些 LINQ 功能吗? How to get to my results?如何获得我的结果?

So does the stored procedure return a result set, and a return value?那么存储过程是否返回结果集和返回值? and the return value is always 0?并且返回值总是0? Is the problem not simply that the value being returned from the query is always the return value?问题不只是查询返回的值始终是返回值吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM