TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tangara G
NA
298
94k
Why my insertion is not working ?
Feb 9 2017 11:02 AM
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"
);
}
Reply
Answers (
5
)
Error “The remote server returned an error: (400) Bad Reques
How to store List<> into array in MVC