Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. exception in stored procedure

exception in stored procedure

Scheduled Pinned Locked Moved ASP.NET
helpdatabase
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NRHSR
    wrote on last edited by
    #1

    Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied.this is the error i am getting while insert into data base using stored procedure can any body help me plz...

    N C M 3 Replies Last reply
    0
    • N NRHSR

      Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied.this is the error i am getting while insert into data base using stored procedure can any body help me plz...

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      NRHSR wrote:

      Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied

      How can an error message be more clear? :)

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • N NRHSR

        Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied.this is the error i am getting while insert into data base using stored procedure can any body help me plz...

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I recommend a job at McDonalds. It seems that computing is too hard for you. The error means what it says.

        Christian Graus Driven to the arms of OSX by Vista.

        L 1 Reply Last reply
        0
        • N NRHSR

          Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied.this is the error i am getting while insert into data base using stored procedure can any body help me plz...

          M Offline
          M Offline
          monu nair
          wrote on last edited by
          #4

          pass parameter '@ID' value to Procedure or Function 'SubmitRecord1'

          Mahendra Bisht.

          1 Reply Last reply
          0
          • C Christian Graus

            I recommend a job at McDonalds. It seems that computing is too hard for you. The error means what it says.

            Christian Graus Driven to the arms of OSX by Vista.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            "What do you mean, 'I din't give you any fries?' Nah - too complex.

            ___________________________________________ .\\axxx (That's an 'M')

            N 1 Reply Last reply
            0
            • L Lost User

              "What do you mean, 'I din't give you any fries?' Nah - too complex.

              ___________________________________________ .\\axxx (That's an 'M')

              N Offline
              N Offline
              NRHSR
              wrote on last edited by
              #6

              Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied. this is the exception i am getting when i run.and my code is protected void Submit1_ServerClick(object sender, EventArgs e) { string constr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection con = new SqlConnection(constr); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd = new SqlCommand("SubmitRecord1", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sp1 = new SqlParameter("@ID",SqlDbType.NVarChar,10); sp1.Value = TextBox1.Text; SqlParameter sp2 = new SqlParameter("@Password",SqlDbType.NVarChar,50); sp2.Value = TextBox2.Text; SqlParameter sp3 = new SqlParameter("@ConfirmPassword",SqlDbType.NVarChar,50); sp3.Value = TextBox3.Text; SqlParameter sp4 = new SqlParameter("@EmailID",SqlDbType.NVarChar,200); sp4.Value = TextBox4.Text; con.Open(); cmd.ExecuteNonQuery(); con.Close(); //cmd.ExecuteNonQuery(); } my stored procedure is CREATE PROCEDURE dbo.SubmitRecord1 ( @ID varchar(10), @Password varchar(50), @ConfirmPassword varchar(50), @EmailID varchar(200) ) AS INSERT INTO login1(ID,Password,ConfirmPassword,EmailID)VALUES(@ID,@Password,@ConfirmPassword,@EmailID) RETURN i am passing parameter ... then also its throwing exception...... can any body help me ...

              L 1 Reply Last reply
              0
              • N NRHSR

                Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied. this is the exception i am getting when i run.and my code is protected void Submit1_ServerClick(object sender, EventArgs e) { string constr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection con = new SqlConnection(constr); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd = new SqlCommand("SubmitRecord1", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sp1 = new SqlParameter("@ID",SqlDbType.NVarChar,10); sp1.Value = TextBox1.Text; SqlParameter sp2 = new SqlParameter("@Password",SqlDbType.NVarChar,50); sp2.Value = TextBox2.Text; SqlParameter sp3 = new SqlParameter("@ConfirmPassword",SqlDbType.NVarChar,50); sp3.Value = TextBox3.Text; SqlParameter sp4 = new SqlParameter("@EmailID",SqlDbType.NVarChar,200); sp4.Value = TextBox4.Text; con.Open(); cmd.ExecuteNonQuery(); con.Close(); //cmd.ExecuteNonQuery(); } my stored procedure is CREATE PROCEDURE dbo.SubmitRecord1 ( @ID varchar(10), @Password varchar(50), @ConfirmPassword varchar(50), @EmailID varchar(200) ) AS INSERT INTO login1(ID,Password,ConfirmPassword,EmailID)VALUES(@ID,@Password,@ConfirmPassword,@EmailID) RETURN i am passing parameter ... then also its throwing exception...... can any body help me ...

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                You're not adding any of the parameters to the command object something like cmd.Parameters.Add(sp1); (Look it up - I don't have an example in front of me - but that's the issue here - upir cmd object doesn't know about the parameters.

                ___________________________________________ .\\axxx (That's an 'M')

                N 1 Reply Last reply
                0
                • L Lost User

                  You're not adding any of the parameters to the command object something like cmd.Parameters.Add(sp1); (Look it up - I don't have an example in front of me - but that's the issue here - upir cmd object doesn't know about the parameters.

                  ___________________________________________ .\\axxx (That's an 'M')

                  N Offline
                  N Offline
                  NRHSR
                  wrote on last edited by
                  #8

                  protected void Submit1_ServerClick(object sender, EventArgs e) { string constr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection con = new SqlConnection(constr); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd = new SqlCommand("SubmitRecord1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ID", SqlDbType.NVarChar,10).Value = TextBox1.Text; cmd.Parameters.Add("@Password", SqlDbType.NVarChar, 50).Value = TextBox2.Text; cmd.Parameters.Add("@ConfirmPassword", SqlDbType.NVarChar, 50).Value = TextBox3.Text; cmd.Parameters.Add("@EmailID", SqlDbType.NVarChar, 200).Value = TextBox4.Text; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } stored procedure ALTER PROCEDURE dbo.SubmitRecord1 ( @ID varchar(10), @Password varchar(50), @ConfirmPassword varchar(50), @EmailID varchar(200) ) AS INSERT INTO login1(ID,Password,ConfirmPassword,EmailID)VALUES(@ID,@Password,@ConfirmPassword,@EmailID) RETURN this worked fine..... for reference u can see link Thanks any ways

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups