i have a gridview Also i have a button and checkbox in every row of gridview. When i check some rows i would like these rows with the button to transfer in another gridview.
Please help me .its very urgent.
Code for 1st page
protected void Page_Load(object sender, EventArgs e)
{
OracleConnection conn = new OracleConnection(conns); // C#
if (rdoApplication.Checked)
{
using (OracleCommand Cmd = new OracleCommand())
{
Cmd.Connection = conn;
Cmd.CommandText = "select * from APPLICATION";
Cmd.CommandType = CommandType.Text;
DataSet ds = new DataSet();
try
{
conn.Open();
OracleDataAdapter da = new OracleDataAdapter(Cmd);
da.SelectCommand = Cmd;
DataTable dt = new DataTable();
da.Fill(dt);
grdApplication.DataSource = dt;
grdApplication.DataBind();
}
catch (Exception ex)
{
//System.Console.WriteLine("Exception: {0}",ex.ToString());
}
conn.Close();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Response.Redirect("ExportToExcel.aspx");
}
Code for 2nd page
private void BindGrid()
{
OracleConnection conn = new OracleConnection(conns); // C#
using (OracleCommand Cmd = new OracleCommand())
{
Cmd.Connection = conn;
Cmd.CommandText = "SELECT * FROM OUTAGE_TASK";
Cmd.CommandType = CommandType.Text;
DataSet ds = new DataSet();
try
{
conn.Open();
OracleDataAdapter da = new OracleDataAdapter(Cmd);
da.SelectCommand = Cmd;
DataTable dt = Session["grdApplication"] as DataTable;
// da.Fill(dt);
// Over here we fetch the datatable from session i.e. stored in previous page and //passed here
// DataTable dts = Session["grdSeacrhResult"] as DataTable;
grdSeacrhResult.DataSource = dt;
grdSeacrhResult.DataBind();
//grdSeacrhResult.DataSource = dt;
//grdSeacrhResult.DataBind();
}
catch (Exception ex)
{
//System.Console.WriteLine("Exception: {0}",ex.ToString());
}
conn.Close();
}
}
protected void Page_Load(object sender, EventArgs e)
{
this.BindGrid();
}