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("@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");
- }