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_projsea rch_update1.
The following is the code for stored procedure:
The following is the new code in the update section of asp.net:
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.
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_projsea rch_update1.
The following is the code for stored procedure:
Code:
alter proc prr_out_projsearch_update1
@prr_id int,
@changes_required bit,
@NeedUpdate bit = 1,
@datecompleted datetime = null,
@poduedate datetime,
@designissues varchar(100),
@designissuesnotes text,
@documentationissues varchar(100),
@documentationissuesnotes text,
@detailissues varchar(100),
@detailissuesnotes text,
@ActionRequired bit = 1,
@ActionRequiredNotes text,
@ChangesCompleted bit = 1
As
set @datecompleted = current_timestamp
update tblprrin
set
changesrequired = @changes_required,
needupdate = @needupdate,
datecompleted = @datecompleted,
PODueDate = @poduedate,
designissues = @designissues,
designissuesnotes = @designissuesnotes,
documentationissues = @documentationissues,
documentationissuesnotes = @documentationissuesnotes,
detailissues = @detailissues,
detailissuesnotes = @detailissuesnotes,
ActionRequired = @ActionRequired,
ActionRequiredNotes = @ActionRequiredNotes,
ChangesCompleted = @ChangesCompleted
where prr_id = @prr_id
Code:
conn_r = New SqlConnection(ConfigurationManager.ConnectionStrings("prsdbConnectString").ConnectionString)
Dim cmd_r As SqlCommand
cmd_r = New SqlCommand("prr_out_projsearch_update1", conn_r)
cmd_r.CommandType = Data.CommandType.StoredProcedure
cmd_r.CommandTimeout = 0
cmd_r.Parameters.Add("@prr_id", Data.SqlDbType.Int)
cmd_r.Parameters("@prr_id").Value = Session("PRR_ID")
cmd_r.Parameters.Add("@changes_required", Data.SqlDbType.Bit)
cmd_r.Parameters("@changes_required").Value = 1
cmd_r.Parameters.Add("@poduedate", SqlDbType.DateTime)
cmd_r.Parameters("@poduedate").Value = CDate(txtDueDate.Text)
cmd_r.Parameters.Add("@designissues", Data.SqlDbType.VarChar)
cmd_r.Parameters("@designissues").Value = (DropDownList2.SelectedItem.Value)
cmd_r.Parameters.Add("@designissuesnotes", Data.SqlDbType.VarChar)
cmd_r.Parameters("@designissuesnotes").Value = txtDesignIssuesNotes.Text
cmd_r.Parameters.Add("@documentationissues", Data.SqlDbType.VarChar)
cmd_r.Parameters("@documentationissues").Value = (DropDownList3.SelectedItem.Value)
cmd_r.Parameters.Add("@documentationissuesnotes", Data.SqlDbType.VarChar)
cmd_r.Parameters("@documentationissuesnotes").Value = txtDocumentationIssuesNotes.Text
cmd_r.Parameters.Add("@detailissues", Data.SqlDbType.VarChar)
cmd_r.Parameters("@detailissues").Value = (DropDownList4.SelectedItem.Value)
cmd_r.Parameters.Add("@detailissuesnotes", Data.SqlDbType.VarChar)
cmd_r.Parameters("@detailissuesnotes").Value = txtDetailIssuesNotes.Text
cmd_r.Parameters.Add("@ActionRequired", Data.SqlDbType.Bit)
cmd_r.Parameters("@ActionRequired").Value = 1
cmd_r.Parameters.Add("@ActionRequiredNotes", Data.SqlDbType.VarChar)
cmd_r.Parameters("@ActionRequiredNotes").Value = txtActionRequiredNotes.Text
cmd_r.Parameters.Add("@ChangesCompleted", Data.SqlDbType.Bit)
cmd_r.Parameters("@ChangesCompleted").Value = 1
Try
conn_r.Open()
cmd_r.ExecuteNonQuery()
lblError1.Visible = True
lblError1.Text = "PRR updated"
Catch ex As Exception
lblError1.Visible = True
lblError1.Text = ex.Message
lblError2.Visible = True
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.