Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
gridview with oracle stored procedure- help!
garrett
15y
6.9k
1
Reply
I get this error when trying to call the update stored procedure from the gridview event handler:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'MMAR_SP_
APPLICATION
_UPDATE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Stored proc:
CREATE
OR
REPLACE
PROCEDURE
RPT
.
MMAR_SP_Application_Update
(
application_id_
IN
MMAR_application
.
application_id%
TYPE,
name_
IN
MMAR_application
.name
%
type,
lob_
IN
mmar_application
.lob
%
type,
region_
IN
mmar_application
.
region%
type,
cvscodelocation_
IN
mmar_application
.
cvscodelocation%
type,
description_
IN
mmar_application
.
description%
type
)
AS
BEGIN
UPDATE
MMAR_APPLICATION
SET
name=
name_
,
lob=
lob_
,
REGION
=
region_
,
CVSCODELOCATION
=
cvscodelocation_
,
DESCRIPTION
=
description_
,
USER_UPDATED
=USER,
DATE_UPDATED
=SYSDATE
WHERE
APPLICATION_ID
=
application_id_
;
COMMIT;
END
MMAR_SP_Application_Update
;
C# Code:
protected
void
gvApplication_RowUpdating(
object
sender,
GridViewUpdateEventArgs
e)
{
GridView
gv = (
GridView
)sender;
GridViewRow
gvr = (
GridViewRow
)gv.Rows[e.RowIndex];
TextBox
temp =
new
TextBox
();
Label
tempLbl =
new
Label
();
OracleConnection
conn =
new
OracleConnection
(
"Data Source=xxx;Persist Security Info=True;User ID=xxx;Password=xxx"
);
conn.Open();
OracleCommand
cmd =
new
OracleCommand
(
"MMAR_SP_APPLICATION_UPDATE"
, conn);
cmd.CommandType =
CommandType
.StoredProcedure;
OracleParameter
prm6 =
new
OracleParameter
(
"application_id_"
,
OracleDbType
.Int64);
prm6.Direction =
ParameterDirection
.Input;
tempLbl = (
Label
)gvr.FindControl(
"Label1"
);
prm6.Value = tempLbl.Text;
cmd.Parameters.Add(prm6);
OracleParameter
prm1 =
new
OracleParameter
(
"name_"
,
OracleDbType
.Varchar2);
prm1.Direction =
ParameterDirection
.Input;
temp = (
TextBox
)gvr.FindControl(
"Textbox1"
);
prm1.Value = temp.Text;
cmd.Parameters.Add(prm1);
OracleParameter
prm2 =
new
OracleParameter
(
"lob_"
,
OracleDbType
.Varchar2);
prm2.Direction =
ParameterDirection
.Input;
temp = (
TextBox
)gvr.FindControl(
"Textbox2"
);
prm2.Value = temp.Text;
cmd.Parameters.Add(prm2);
OracleParameter
prm4 =
new
OracleParameter
(
"region_"
,
OracleDbType
.Varchar2);
prm4.Direction =
ParameterDirection
.Input;
temp = (
TextBox
)gvr.FindControl(
"Textbox3"
);
prm4.Value = temp.Text;
cmd.Parameters.Add(prm4);
OracleParameter
prm3 =
new
OracleParameter
(
"cvscodelocation_"
,
OracleDbType
.Varchar2);
prm3.Direction =
ParameterDirection
.Input;
temp = (
TextBox
)gvr.FindControl(
"Textbox4"
);
prm3.Value = temp.Text;
cmd.Parameters.Add(prm3);
OracleParameter
prm5 =
new
OracleParameter
(
"description_"
,
OracleDbType
.Varchar2);
prm5.Direction =
ParameterDirection
.Input;
temp = (
TextBox
)gvr.FindControl(
"Textbox5"
);
prm5.Value = temp.Text;
cmd.Parameters.Add(prm5);
cmd.ExecuteNonQuery();
conn.Close();
gvApplication.DataBind();
}
Any idea why I keep getting this error no matter what I try?
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
when to use abstract class and when to use interface?
picasa interface