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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:50:51+00:00 2026-05-25T02:50:51+00:00

if you please heap me out i have an error error: Must declare the

  • 0

if you please heap me out i have an error

error:

Must declare the scalar variable “@Criteria”.

since i don’t have a lot of experience i can not find the problem thanks

code:

public static void CreateReveiw(string paperId, string Criteria_Id, string Grate)
{



    var sqlCon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);




    SqlCommand cmd = new SqlCommand();
    cmd.Connection = sqlCon;
    cmd.CommandText = "select Review_paper_ID from ReviewPaper where Paper_ID= @PaperId";
    cmd.Parameters.AddWithValue("@PaperId", paperId);
    cmd.Connection.Open();
    string Review_paper_ID = cmd.ExecuteScalar().ToString();
    cmd.Connection.Close();
    cmd.Dispose();





    string query2 = @"insert into ReviewPaperCriteria(Review_paper_ID,Criteria_ID,Grate) 
                     values(@Review_paper_ID,@Criteria,@Grate);select SCOPE_IDENTITY() as RPID";

    cmd = new SqlCommand(query2, sqlCon);
    cmd.Parameters.AddWithValue("@Review_paper_ID", Review_paper_ID);
    cmd.Parameters.AddWithValue("@Criteria_ID", Criteria_Id);
    cmd.Parameters.AddWithValue("@Grate", Grate);

    string ReviewPaperId;

    try
    {
        cmd.Connection.Open();
        ReviewPaperId = cmd.ExecuteScalar().ToString();
        cmd.Connection.Close();
    }
    catch (Exception ee) { throw ee; }
    finally { cmd.Dispose(); }



    }
  • 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-25T02:50:52+00:00Added an answer on May 25, 2026 at 2:50 am

    You’re declaring the variable @Criteria but attempting to set its value using @Criteria_ID.

    Change

     cmd.Parameters.AddWithValue("@Criteria_ID", Criteria_Id);
    

    To

     cmd.Parameters.AddWithValue("@Criteria", Criteria_Id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please help to figure this out. I have some leaking code, and I don't
Can any one help me to find out the error cause in tomcat. i
Can someone please tell me the point of the STL heap function templates like
I have a stack overflow error, and I'm fairly sure I don't have any
Please tell me the difference between stack and heap with respect to below code
I've got a buffer overrun I absolutely can't see to figure out (in C).
Every process can use heap memory to store and share data within the process.
I have an class A which uses a heap memory allocation for one of
I am getting this error: Exception in thread main java.lang.OutOfMemoryError: Java heap space at
i have following pseudo code : void siftup(int n) pre condition n>0 && heap(1,n-1)

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.