Hi I've created a form that updates a database. My problem is, while online, two people can concurrently attempt to update a record in the database but thanx to the stored procedure's T-SQL, only the first person to post his record will be able to update the
database. I would like to redirect users who have successfully updated the database to Advertisethanx.aspx & those who were unsuccessful to Advertisesorry.aspx. How should I modify the eventhandler code for the update button below? private void btnBuy_Click(object
sender, System.EventArgs e) { cmdGoldupdate.Parameters["@timer"].Value = ddlTimer.SelectedItem.Text; cmdGoldupdate.Parameters["@org"].Value = txbOrg.Text; cmdGoldupdate.Parameters["@url"].Value = txbUrl.Text; cmdGoldupdate.Parameters["@email"].Value = txbEmail.Text;
cmdGoldupdate.Parameters["@message"].Value = txbMessage.Text; conn_IDSLadvertising.Open(); cmdGoldupdate.ExecuteNonQuery(); conn_IDSLadvertising.Close(); if (Response.BufferOutput == true) { Response.Redirect("Advertisethanx.aspx"); } else { Response.Redirect("Advertisesorry.aspx");
} }
Nstephen
Member
20 Points
4 Posts
Somebody Help
Aug 02, 2003 12:06 PM|LINK