protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { AmountBox.Text = Request.QueryString[0].ToString(); lblCustNotes.Text = Request.QueryString[1].ToString(); lblOrderId.Text = OrderID().ToString(); } } protected int OrderID() { string query = "SELECT MAX(OrderID) FROM Orders"; int id = Query.Scaller(query, 0); return id + 000; } protected void btnSubmit_Click(object sender, EventArgs e) { Response.Redirect("~/SubmitData.aspx?x=" + AmountBox.Text + "&y=" + lblCustNotes.Text+"&z="+lblOrderId.Text); }
// This code example demonstrates the Guid.NewGuid() method. using System; class Sample { public static void Main() { Guid g; // Create and display the value of two GUIDs. g = Guid.NewGuid(); Console.WriteLine(g); Console.WriteLine(Guid.NewGuid()); } } /* This code example produces the following results: 0f8fad5b-d9cb-469f-a165-70867728950e 7c9e6679-7425-40de-944b-e07fc1f90ae7 */
string query = @"DECLARE @MAX_Id int=null; SELECT MAX_Id= MAX(OrderID) FROM Orders ; SET MAX_Id=MAX_Id +1; SELECT MAX_Id;";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)