Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Why my insertion is not working ?
Tangara G
Feb 9 2017 11:02 AM
182
Reply
Hi expert,
Can someone advise me if there is anything wrong with the below code cos my insertion is not working.
internal
void
UpdateRequest(string action, string RefNo, string name,
int
status)
{
con.Open();
SqlCommand cmd =
new
SqlCommand(UpdateRequest", con);
cmd.Parameters.AddWithValue("@action", action);
cmd.Parameters.AddWithValue(
"@PMTNo"
, RefNo);
cmd.Parameters.AddWithValue(
"@name"
, Name);
cmd.Parameters.AddWithValue(
"@status"
, status);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
con.Close();
}
My stored Procedure :
if
@action=
'Save'
or @action=
'Submit'
begin
Insert into REQUEST
([RefNo, Name, status
Values (
@PMTNo, @name, @status))
internal
void
UpdateRequest(string action, string RefNo, string IssuerName
int status)
{
DAO.UpdateRequest(action, RefNo, status);
protected
void
btnSave_Click(object sender, EventArgs e)
{
if
(Request.QueryString[
"RefID"
] != null)
{
string Action =
"Save"
;
string RefNo = Request.QueryString[
"RefID"
].ToString();
UpdateRequest(action, RefNo, status);
Response.Redirect(
"abc.aspx"
);
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Error “The remote server returned an error: (400) Bad Reques
How to store List<> into array in MVC