i want to pass one parameter on two pages ,i tired but just parameter passing one page below is code ,i have to print report by pass parameter using crystal repot
cmd.Parameters["@OID"].Direction = ParameterDirection.Output;
Below is insert code
protected void btn_SD_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=server;Integrated Security=SSPI;Initial Catalog=SilverProduction;MultipleActiveResultSets=True;");
SqlCommand cmd = new SqlCommand("spInsertPorderder", con);
btn_SD.Enabled = false;
{
int P = int.Parse(prdqty.Text);
if (txtpno.Text == "")
{
Response.Write("<script>alert('Please Select Order No')</script>");
}
else if (DDlWrknam.SelectedValue == "0")
{
Response.Write("<script>alert('Please Select Worker')</script>");
}
else if (P > 1 && txtrmk.Text == "")
{
Response.Write("<script>alert('Please Input Remarks')</script>");
}
else
{
cmd.CommandType = CommandType.StoredProcedure;
// cmd.Parameters.AddWithValue("@RollNo", TextBox4.Text.Trim());
cmd.Parameters.AddWithValue("@Codeitem", ddpitem.SelectedValue);
cmd.Parameters.AddWithValue("@OrderNo", txtpno.Text);
cmd.Parameters.AddWithValue("@prdqty", prdqty.Text.Trim());
cmd.Parameters.AddWithValue("@IDWoker", DDlWrknam.SelectedValue);
cmd.Parameters.AddWithValue("@EntryDate", txtentrydate.Text);
cmd.Parameters.AddWithValue("@FID", DDLFl.SelectedValue);
cmd.Parameters.AddWithValue("@PBsize", txtpbs.Text);
cmd.Parameters.AddWithValue("@SecID", DDSecbas.SelectedValue);
cmd.Parameters.AddWithValue("@Rmk", txtrmk.Text);
cmd.Parameters.AddWithValue("@ETime", DateTime.Now.ToString("hh:mm"));
cmd.Parameters.Add("@OID", SqlDbType.Int);
cmd.Parameters["@OID"].Direction = ParameterDirection.Output;
con.Open();
cmd.ExecuteNonQuery();
int ResultValue = Convert.ToInt32(cmd.Parameters["@OID"].Value);
if (ResultValue > 1)
{
Response.Redirect("CRSD.aspx?OID=" + ResultValue + "");
Response.Redirect("CRBigbal.aspx?OID=" + ResultValue + "");
}
else
{
Response.Write("<script>alert('Record Not save')</script>");
}
con.Close();
}
}