protected void Search_Batch_Test_Btn_Click(object sender, EventArgs e) { string keyword = Search_Batch_Test_Console.Text; DataTable temp_table = new DataTable(); temp_table.Columns.Add(new DataColumn("Batch_Test_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("Batch_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("Test_ID", typeof(string))); temp_table.Columns.Add(new DataColumn("TimeStamp", typeof(string))); for (int i = 0; i < find.Test_NAME(keyword).Rows.Count; i++) { for (int j = 0; j < find.Batch_Test_TestID(find.Test_NAME(keyword).Rows[i]["Test_ID"].ToString()).Rows.Count; j++) { temp_table.ImportRow(find.Batch_Test_TestID(find.Test_NAME(keyword).Rows[i]["Test_ID"].ToString()).Rows[j]); } } for (int i = 0; i < find.Batch_Name(keyword).Rows.Count; i++) { for (int j = 0; j < find.Batch_Test_BATCHID(find.Batch_Name(keyword).Rows[i]["Batch_ID"].ToString()).Rows.Count; j++) { temp_table.ImportRow(find.Batch_Test_BATCHID(find.Batch_Name(keyword).Rows[i]["Batch_ID"].ToString()).Rows[j]); } } All_Test.DataSource = temp_table; All_Test.DataBind(); }