Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:13:32+00:00 2026-06-17T06:13:32+00:00

I have a stored proc which takes a int as parameter. I am using

  • 0

I have a stored proc which takes a int as parameter. I am using entity framework code first along with MVC and I am making the call in this manner

        SqlParameter sa = new SqlParameter("@userId", userId);
        var query = from dashboardData in TBSCIDBContext.Database.SqlQuery<MyNomination>("sp_GetMyNominationList @userId", sa)
                    select dashboardData;
        return query.ToList();

in profiler I get

exec sp_executesql N'sp_GetMyNominationList @userId',N'@userId int',@userId=4  

This executes correctly on using sql server 2008 but now my db is changed to 2005
and the same exec statement gives me

Incorrect syntax near ‘sp_GetMyNominationList’. because I am running it in 2005.

I have to use 2005 please tell me a way to make this run in 2005 so that the parameter is taken correctly by the sql profiler

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:13:33+00:00Added an answer on June 17, 2026 at 6:13 am

    The answer to my question is

      SqlParameter sa = new SqlParameter("@userId", userId);
                var query = from dashboardData in TBSCIDBContext.Database.SqlQuery<MyNomination>("exec sp_GetMyNominationList @userId=@userId", sa)
                            select dashboardData;
    

    This works

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MS SQL 2005 stored proc which takes an out parameter. How
I am using SQL 2000. I have a stored proc, spGetApplicantList , which cannot
I have a stored proc on sql server 2008 that excepts a int parameter.
Lets say I have a stored proc call MyStoredProc which recieved an int (@MyParam
I have a stored proc with a parameter which I want to have contain
Currently I have a stored proc, which takes a string @vari as varchar(30) if
I have a stored proc that takes several parameters, two of which allow nulls.
Using SQL Server 2008. I have a stored proc which has start and end
I have a datetime parameter value in stored proc which will receive value like
I am using SSRS 2008 and i have a stored proc which currently uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.