I have below code, that has a datatable dt. And I have one more datatable named dt1. I want to check dt has dt1 data before merge both table. If dt already has dt1 data I don't want to merge both datatable.
Ideally looking for a dt.Exists(dt1) like code.
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[6] { new DataColumn("ID", typeof(int)),
new DataColumn("Acount", typeof(string)),
new DataColumn("Name", typeof(string)),
new DataColumn("Quarter", typeof(string)),
new DataColumn("FY", typeof(int)),
new DataColumn("Income_percent", typeof(int))});
dt.Rows.Add(1, "ABC", "Ram", "Q1", 2011, 50);
dt.Rows.Add(2, "XYZ", "Hari", "Q4", 2011, 35);
dt.Rows.Add(3, "ABC", "Rohit", "Q3", 2011, 40);
dt.Rows.Add(4, "ABC", "Ram", "Q2", 2011, 25);
dt.Rows.Add(5, "XYZ", "Hari", "Q3", 2011, 60);
DataTable dt1 = new DataTable();
dt1.Rows.Add(3, "ABC", "Rohit", "Q3", 2011, 40);
dt1.Rows.Add(4, "ABC", "Ram", "Q2", 2011, 25);
dt1.Rows.Add(5, "XYZ", "Hari", "Q3", 2011, 60);
}
}