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 706617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:11:11+00:00 2026-05-14T04:11:11+00:00

Driving me mad on a personal project; I know I’ve done this before but

  • 0

Driving me mad on a personal project; I know I’ve done this before but elsewhere and don’t have the code. As far as I can see, I’m setting the parameter, I’m setting its value, the connection is open, yet when I try to fill the dataset I get the error ‘Procedure or function expects parameter “@test” which was not supplied’.

(This is obviously a simplified test! Same error on this or the real, rather longer code though.)

C#:

SqlCommand l_oCmd;
DataSet l_oPage = new DataSet();

l_oCmd = new SqlCommand("usp_test", g_oConn);
l_oCmd.Parameters.Add(new SqlParameter("@test", SqlDbType.NVarChar));
l_oCmd.Parameters[0].Value = "hello world";

SqlDataAdapter da = new SqlDataAdapter(l_oCmd);
da.Fill(l_oPage);

SQL:

create procedure usp_test
(
    @test nvarchar(1000)
)
as
select @test

What have I missed?

  • 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-05-14T04:11:11+00:00Added an answer on May 14, 2026 at 4:11 am

    Change the command type to Procedure

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

Sidebar

Related Questions

This is driving me mad , I have a code that works perfect with
my jQuery skills are pretty good normally but this is driving me mad! It's
This has been driving me mad someone help coz i don't seem to see
This problem has been driving me mad. Here's the general gist: I have two
this is driving me MAD now.. I have a UItableview. Based on an NSMutableArray,
Anyone ever seen anything like this before? It's driving me mad! Basically, I've got
Ok so this is driving me mad. how can this code possibly not work?
Total newbie question but this is driving me mad! I'm trying this: myInt =
See update below. This is driving me mad. I have followed all the instructions
Ok, so this has been driving me mad for a while, but it occasionally

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.