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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:04:57+00:00 2026-06-09T02:04:57+00:00

I have the following ASP.NET (VB) code below. My goal is to get the

  • 0

I have the following ASP.NET (VB) code below.
My goal is to get the output of a stored proc that accepts 1 parameter and store that info
into a data table:

        Dim strConnection1 As String = System.Configuration.ConfigurationManager.AppSettings("Rdf2012")
        Dim conn1 As System.Data.SqlClient.SqlConnection
        conn1 = New System.Data.SqlClient.SqlConnection(strConnection1)
        Dim cmd1 As New SqlCommand
        Dim prm1 As New SqlParameter
        Dim dtDataTable1 As DataTable
        cmd1.Connection = conn1
        cmd1.CommandText = "usp_GetDetails"
        cmd1.CommandType = CommandType.StoredProcedure
        prm1 = cmd1.Parameters.Add(strProgramID, SqlDbType.VarChar, 50)
        prm1.Direction = ParameterDirection.Input

        conn1.Open()

        Dim dataAdapter As New SqlDataAdapter
        dataAdapter.SelectCommand = cmd1

        Dim ds1 As New DataSet
        dataAdapter.Fill(ds1)
        conn1.Close()

        dtDataTable1 = ds1.Tables("Table1")

Program stops at

    dataAdapter.Fill(ds1) and says:

@1012952-4403 is not a parameter for procedure usp_GetDetails

This is what the stored proc looks like:

    ALTER PROCEDURE [dbo].[usp_GetDetails]
@ProId VARCHAR(20) = NULL
    AS
  • 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-09T02:04:58+00:00Added an answer on June 9, 2026 at 2:04 am

    You need to do

    prm1 = cmd1.Parameters.AddWithValue ("@ProID", strProgramID)
    

    instead of

     prm1 = cmd1.Parameters.Add(strProgramID, SqlDbType.VarChar, 50) 
     prm1.Direction = ParameterDirection.Input 
    

    Direction will be assumed to be input unless otherwise specified.

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

Sidebar

Related Questions

I have following asp.net code but it gives error when I change dropdown selected
Anything I have tried didn't work. Currenly I have following code to change asp.net
I have the following code in my ASP.NET project public sealed class IoC {
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have the following code in a ASP.NET master page: <div id=hyperlinkimage><asp:HyperLink ID=SomeHyperLink runat=Server
I am using ASP.NET 3.5 with iTextSharp and I have the following code: var
This is a beginner level question for asp.net MVC I have the following code
In The Page_Load event of an ASP.NET USercontrol, I have the following Code: If
I have somebody elses code (C# ASP.Net) which contains the following query: string query
I have an ASP.NET web site with something similar to the following code: .aspx

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.