none
My SP not returning columns to EF, but returning in MSMQ RRS feed

  • Question

  • html,body{padding:0;margin:0;font-family:Verdana,Geneva,sans-serif;background:#fff;}html{font-size:100%}body{font-size:.75em;line-height:1.5;padding-top:1px;margin-top:-1px;}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;padding:0 .2em}.t-marker{display:none;}.t-paste-container{;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}a{color:#00a}code, pre{font-size:1.23em}
    Hi MSDN,

    Firstly i'm using EF 4, VS 2010, ASP.net 4, MS SQL

    Here i have a sql Stored Procedure, which returns data in SQL Server, when i return or Mapped it to Function Import with a return type "QsByTopic" with it is saying "The selected procedure returns no columns", but i'm in MSMQ.

    Please check with my code of SP

    ALTER PROCEDURE PopulateAllObjectiveQuestionsByTopic
        @TopicID varchar(10)
        as SET NOCOUNT on

       SET FMTONLY OFF
        begin
      Declare @LevelID varchar(10)   
      select @LevelID = substring(@TopicID,1,2)
      declare @SQLString varchar(max)
      select @SQLString = 'select QID,Marks,Question from   QBObjective where '+@LevelID+'SubjectID='''+@TopicID+'''' 
      exec (@SQLString)
        end

    -- I'm getting out put if i execute at MSMQ as

    PopulateAllObjectiveQuestionsByTopic 'L10000'

    Here is my return type "QsByTopic"

    namespace OEPS
    {
        using System;
       
        public partial class QsByToipc
        {
        }
    }

    which also saying there is no return type, Can you please assist me, Is the SQL code is safe? If yes, how do i retrun rows using this SP.

    I create this procedure, by taking help from the link,

    http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/9e5ed2ee-4d44-4d23-9753-20777fbd55ca, as i want to assign column name dynamically.



    Monday, November 5, 2012 7:05 AM

All replies

  • Hi NSR Krishna S,

    Welcome to MSDN Forum.

    When you import the stored procedure as function, how did you set the return type for the function in the wizard? If the return type isn't an entity, you can let the wizard help you to generate a new complex type to retrieve the return value.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 6, 2012 2:32 AM
    Moderator