using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace adi
{
public partial class WebForm4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
copy_data();
}
public void copy_data()
{
DataTable dt1 = new DataTable();
dt1.Columns.AddRange(new DataColumn[1] { new DataColumn("Id") });
dt1.Rows.Add("4");
dt1.Rows.Add("5");
dt1.Rows.Add("6");
dt1.Rows.Add("7");
dt1.Rows.Add("8");
dt1.Rows.Add("11");
dt1.Rows.Add("13");
DataTable dt2 = new DataTable();
dt2.Columns.AddRange(new DataColumn[1] { new DataColumn("Id") });
for (int i = 0; i < dt1.Rows.Count; i++)
{
for (int j = 0; j < dt1.Columns.Count; j++)
{
dt2.Rows.Add(dt1.Rows[i][j]);
}
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace adi
{
public partial class WebForm4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
copy_data();
}
public void copy_data()
{
DataTable dt1 = new DataTable();
dt1.Columns.AddRange(new DataColumn[1] { new DataColumn("Id") });
dt1.Rows.Add("4");
dt1.Rows.Add("5");
dt1.Rows.Add("6");
dt1.Rows.Add("7");
dt1.Rows.Add("8");
dt1.Rows.Add("11");
dt1.Rows.Add("13");
DataTable dt2 = new DataTable();
dt2.Columns.AddRange(new DataColumn[1] { new DataColumn("Id") });
for (int i = 0; i < dt1.Rows.Count; i++)
{
for (int j = 0; j < dt1.Columns.Count; j++)
{
dt2.Rows.Add(dt1.Rows[i][j]);
}
}
}
}
}
No comments:
Post a Comment