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: -
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
-
The following is the new code in the update section of asp.net: -
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.
0 1140 Sign in to post your reply or Sign up for a free account.
Similar topics
by: DaylonRed |
last post by:
Could someone help me out here? I have created a pretty large Stored
Procedure with about 5 different parameters however, when I run the
procedure I get the following error:
"Syntax error...
|
by: Wally |
last post by:
I am trying to display images from an Access 2000 database and I get an error
"Invalid Parameter Used" when I execute the code line
"picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
|
by: Dan |
last post by:
I can't figure out this error message. Could someone please help.
I have a text file in Notepad with the following 4 fields (Cont, Code,
List, and Numb)all of which are single tab delimited, and a...
|
by: Jeremy Ames |
last post by:
I have a datagrid that updates the table using a stored procedure. The stored procedure is confirmed to complete correctly, yet the sql data adapter is returning an error that my application is...
|
by: Jack |
last post by:
Hi,
I am trying to run an example code from a book. However I am getting the
following error message:
Number: -2147217900
Description: Syntax error or access violation
Source: Microsoft OLE...
|
by: Scott |
last post by:
I have a BeforeUpdate Event Procedure as below and got an error message.
BeforeUpdate Event Procedure
If IsNull() Then
= Now()
Else
= Now()
End If
|
by: Mike P |
last post by:
I am repeatedly getting the error message 'error converting datatype
varchar to bit'. I am passing a varchar variable to a stored procedure
(where it is also a varchar) and then trying to write it...
|
by: barmatt80 |
last post by:
I am stumped on the error reporting with sql server. I was told i
need to return @SQLCode(code showing if successful or not) and
@ErrMsg(and the message returned). I am clueless on this.
I...
|
by: =?Utf-8?B?U3RldmVTNjA=?= |
last post by:
I apparently made an unknown error. Now when I attempt to install two
software packages I receive error messages. One package results in the
message "The procedure entry point CallWindowProMF...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |