```
public void buttonclick(object sender,eventArgs e)
{
    SqlConnection con0 = new SqlConnection(ConfigurationManager.ConnectionStrings["BUM"].ConnectionString);
    con0.Open();

    SqlCommand cmd0 = new SqlCommand("", con0);
    con0.Close();

    SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["BUM"].ConnectionString);
    con1.Open();

    SqlCommand cmd3 = new SqlCommand("book_master_insert", con1);
    cmd3.CommandType = CommandType.StoredProcedure;

    SqlParameter customer_id = new SqlParameter("@customer_id", cust_id);
    SqlParameter booking_from = new SqlParameter("@booking_from", ddlfrom.SelectedItem.Text);
    SqlParameter booking_destination = new SqlParameter("@booking_destination", ddlto.SelectedItem.Text);
    SqlParameter load_type = new SqlParameter("@load_type", ddlLoadtype.SelectedItem.Text);
    SqlParameter no_of_containers = new SqlParameter("@no_of_containers", txt_no_of_container.Text);
    SqlParameter booking_pickupdate = new SqlParameter("@booking_pickupdate", txt_date.Text);
    SqlParameter booking_pickuptime = new SqlParameter("@booking_pickuptime", txt_time.Text);
    SqlParameter booking_createdate = new SqlParameter("@booking_createdate", localDate);

    cmd3.Parameters.Add(customer_id);
    cmd3.Parameters.Add(booking_createdate);
    cmd3.Parameters.Add(booking_from);
    cmd3.Parameters.Add(booking_destination);
    cmd3.Parameters.Add(load_type);
    cmd3.Parameters.Add(no_of_containers);
    cmd3.Parameters.Add(booking_pickupdate);
    cmd3.Parameters.Add(booking_pickuptime);

    cmd3.ExecuteNonQuery();
    con1.Close();

    SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["BUM"].ConnectionString);
    con2.Open();

    SqlCommand cmd2 = new SqlCommand("select  booking_ID from booking_master where customer_id='"+cust_id+"' and booking_from='" + ddlfrom.SelectedItem.Text + "'and booking_destination='" + ddlto.SelectedItem.Text + "' and load_type='" + ddlLoadtype.SelectedValue + "' and no_of_containers='" + txt_no_of_container.Text + "' and CAST (booking_pickupdate as date) ='" + txt_date.Text + "' and booking_pickuptime='" + txt_time.Text + "';", con2);

    SqlDataReader rdr = cmd2.ExecuteReader();

    while (rdr.Read())
    {
        booking_ID = rdr["booking_ID"].ToString();
    }

    con2.Close();
}

```