问题描述
我正在使用这个存储过程
i am using this stored procedure
ALTER PROCEDURE [dbo].[MyProcedure]
@pSelect nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SQL nvarchar(max)
SET @SQL = 'select ' + @pSelect + ' from vwAcdAdmissionWithvwAcdAdmissionSessionDetailWithAllMaster';
EXEC (@SQL)
END
并使用 linq 从 c#.net entitydatamodel 执行它
and executing it from c#.net entitydatamodel with linq
shoolSoulDataEntites db = new schoolSoulDataEntites;var ss = db.Myprocedure("column1,column2");
shoolSoulDataEntites db = new schoolSoulDataEntites;var ss = db.Myprocedure("column1,column2");
但它返回一个整数值我想要程序结果的所有记录请帮助我
but it is returning a integer valuei want all records of the result of procedureplss help me
推荐答案
不,它不返回整数值.
正是您调用的方法返回了整数值.我猜你正在调用 ExecuteScalar 来执行存储过程.您需要将其更改为 executeNonQuery 并使用一些数据适配器来填充您的数据集/数据表.
It is the method that you are calling that is returning you integer value. I guess you are calling ExecuteScalar to execute store procedure. You need to change it to executeNonQuery and use some dataadapter to fill up your dataset/datatable.
这篇关于如何从存储过程返回所有记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!