By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

Error message: @poduedate is not a parameter for procedure prr_out_projsearch_update1

P: 4
Hi

I have a web form which is a part of asp.net application. This process updates a row of a table. This works fine. However I needed to add a DueDate field in the form and update the DueDate field in the back end as well. So I added the DueDate field in the form and changed the stored procedure and the corresponding code in asp.net. Now the update does not work.

I am getting the following error message:

@poduedate is not a parameter for procedure prr_out_projsearch_update1.

The following is the code for stored procedure:
Expand|Select|Wrap|Line Numbers
  1. alter proc prr_out_projsearch_update1 
  2.  
  3. @prr_id int,
  4. @changes_required bit,
  5. @NeedUpdate bit = 1,
  6. @datecompleted datetime = null,
  7. @poduedate datetime,
  8. @designissues varchar(100),
  9. @designissuesnotes text,
  10. @documentationissues varchar(100),
  11. @documentationissuesnotes text,
  12. @detailissues varchar(100),
  13. @detailissuesnotes text,
  14. @ActionRequired bit = 1,
  15. @ActionRequiredNotes text,
  16. @ChangesCompleted bit = 1
  17.  
  18. As
  19. set @datecompleted = current_timestamp
  20.  
  21.  
  22. update tblprrin
  23. set 
  24.      changesrequired = @changes_required,
  25.      needupdate = @needupdate,
  26.      datecompleted = @datecompleted,
  27.      PODueDate = @poduedate,
  28.      designissues =  @designissues,
  29.      designissuesnotes = @designissuesnotes,
  30.      documentationissues = @documentationissues,
  31.      documentationissuesnotes  = @documentationissuesnotes,
  32.      detailissues = @detailissues,
  33.      detailissuesnotes =  @detailissuesnotes,
  34.      ActionRequired = @ActionRequired,
  35.      ActionRequiredNotes = @ActionRequiredNotes,
  36.      ChangesCompleted = @ChangesCompleted
  37.  
  38. where prr_id = @prr_id
  39.  
The following is the new code in the update section of asp.net:
Expand|Select|Wrap|Line Numbers
  1. conn_r = New SqlConnection(ConfigurationManager.ConnectionStrings("prsdbConnectString").ConnectionString)
  2.             Dim cmd_r As SqlCommand
  3.             cmd_r = New SqlCommand("prr_out_projsearch_update1", conn_r)
  4.             cmd_r.CommandType = Data.CommandType.StoredProcedure
  5.             cmd_r.CommandTimeout = 0
  6.  
  7.  
  8. cmd_r.Parameters.Add("@prr_id", Data.SqlDbType.Int)
  9.  
  10.                 cmd_r.Parameters("@prr_id").Value = Session("PRR_ID")
  11.  
  12.                 cmd_r.Parameters.Add("@changes_required", Data.SqlDbType.Bit)
  13.                 cmd_r.Parameters("@changes_required").Value = 1
  14.  
  15.                 cmd_r.Parameters.Add("@poduedate", SqlDbType.DateTime)
  16.                 cmd_r.Parameters("@poduedate").Value = CDate(txtDueDate.Text)
  17.  
  18.                 cmd_r.Parameters.Add("@designissues", Data.SqlDbType.VarChar)
  19.                 cmd_r.Parameters("@designissues").Value = (DropDownList2.SelectedItem.Value)
  20.  
  21.                 cmd_r.Parameters.Add("@designissuesnotes", Data.SqlDbType.VarChar)
  22.                 cmd_r.Parameters("@designissuesnotes").Value = txtDesignIssuesNotes.Text
  23.  
  24.                 cmd_r.Parameters.Add("@documentationissues", Data.SqlDbType.VarChar)
  25.                 cmd_r.Parameters("@documentationissues").Value = (DropDownList3.SelectedItem.Value)
  26.  
  27.                 cmd_r.Parameters.Add("@documentationissuesnotes", Data.SqlDbType.VarChar)
  28.                 cmd_r.Parameters("@documentationissuesnotes").Value = txtDocumentationIssuesNotes.Text
  29.  
  30.                 cmd_r.Parameters.Add("@detailissues", Data.SqlDbType.VarChar)
  31.                 cmd_r.Parameters("@detailissues").Value = (DropDownList4.SelectedItem.Value)
  32.  
  33.                 cmd_r.Parameters.Add("@detailissuesnotes", Data.SqlDbType.VarChar)
  34.                 cmd_r.Parameters("@detailissuesnotes").Value = txtDetailIssuesNotes.Text
  35.  
  36.  
  37.  
  38.                 cmd_r.Parameters.Add("@ActionRequired", Data.SqlDbType.Bit)
  39.                 cmd_r.Parameters("@ActionRequired").Value = 1
  40.  
  41.  
  42.                 cmd_r.Parameters.Add("@ActionRequiredNotes", Data.SqlDbType.VarChar)
  43.                 cmd_r.Parameters("@ActionRequiredNotes").Value = txtActionRequiredNotes.Text
  44.  
  45.                 cmd_r.Parameters.Add("@ChangesCompleted", Data.SqlDbType.Bit)
  46.                 cmd_r.Parameters("@ChangesCompleted").Value = 1
  47.  
  48.  
  49. Try
  50.  
  51. conn_r.Open()
  52.  
  53. cmd_r.ExecuteNonQuery()
  54.  
  55. lblError1.Visible = True
  56.  
  57. lblError1.Text = "PRR updated"
  58.  
  59.  
  60.  
  61. Catch ex As Exception
  62.  
  63. lblError1.Visible = True
  64.  
  65. lblError1.Text = ex.Message
  66.  
  67. lblError2.Visible = True
  68.  
  69. lblError2.Text = "Record not added. Please report error message to system admin."


Here the date field addition should be an issue as it was working fine before. I would appreciate any help to resolve this issue. Thanks.
Mar 3 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.