I have a Webforms project and I have the information going into a database. My question is, after submitting the page, how can I retrieve and display the newly created ID
(primary key) on the next page in a label? Is this even possible to do?
I have this code for retrieving the ID based of an old project I did:
SqlCommand da3 = new SqlCommand(strSelectCmd3, conn);
da3.CommandType = CommandType.StoredProcedure;
SqlDataAdapter ds3 = new SqlDataAdapter();
ds3.SelectCommand = da3;
DataSet dsPerson3 = new DataSet();
ds3.Fill(dsPerson3);
Response.Redirect("Submitted.aspx?ID=" + dsPerson3.Tables[0].Rows[0]["CremationID"].ToString());