我编写了C#程序,并使用Linq访问数据库。我写了下面的存储过程,但我不知道,我如何才能访问我的program.Help中的返回值我该怎么做?
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create Procedure [dbo].[StrPC_BDPathData_CustomSelectDistance]
@PkPathData_Id int
As
Begin
Select [Dstc]
From BDPathData
Where
[PkPathData_Id] = @PkPathData_Id
End所以在我的程序中使用下面的代码:
DataClassesDataContext data = new DataClassesDataContext();
int Distance =int.Parse(data.StrPC_BDPathData_CustomSelectDistance(10));但是距离值没有变化,请帮帮忙...
发布于 2012-01-22 03:32:10
这取决于您如何在ORM中映射对象,但您可能需要如下内容:
DataClassesDataContext data = new DataClassesDataContext();
var Results = data.StrPC_BDPathData_CustomSelectDistance(10);
int Distance =int.Parse(Results(0).Dstc);https://stackoverflow.com/questions/8955635
复制相似问题