Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
725 views
in Technique[技术] by (71.8m points)

linq to sql - The return types for the following stored procedures could not be detected

While drag-drop a stored procedure in dbml file I get this error:

Unknown Return Type
The return types for the following stored procedures could not be detected. Set the return type for each stored procedure in the Properties window.

How can I resolve this error?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This problem occurs whenever the designer cannot figure out the return type of the SP.
Same problem and solutions described here
How to get multiple result set of procedure using LINQ to SQL

Basically this is the solution from the link:

Avoid using #temp Table in your stored procedure, instead of you can use Table type variable like below (@TempTable)

Ex:

DECLARE @TempTable TABLE
(
  AttributeID INT,
  Value NVARCHAR(200)
)

INSERT INTO @TempTable Select * from Attribute

OR

--Execute SP and insert results into @TempTable
INSERT INTO @TempTable Exec GetAttribute @Id

You can do all operation which you was doing with #Temp table like Join, Insert, Select etc.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...