| 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 |         private void button4_Click(object sender, EventArgs e)
        {
            DataTable dt1 = GetDataTable1Dst016();
            DataTable dt2 = GetDataTable2Dst016();
            List<string> filter = new List<string> ();
            filter.Add("name");
            bool result = dst016.CompareDataTable(dt1, dt2, filter);
            Console.WriteLine("比較結果:" + result);
        }
        private DataTable GetDataTable1Dst016()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("no", typeof(string));
            dt.Columns.Add("name", typeof(string));
            dt.Columns.Add("value", typeof(int));
            dt.Rows.Add("S0001", "あんぱん", 100);
            dt.Rows.Add("S0002", "メロンパン", 105);
            dt.Rows.Add("S0003", "カレーパン", 110);
            dt.Rows.Add("S0004", "いちごジャムパン", 115);
            dt.Rows.Add("S0005", "チョココロネ", 120);
            dt.Rows.Add("S0006", "クロワッサン", 125);
            dt.Rows.Add("S0007", "クリームパン", 130);
            return dt;
        }
        private DataTable GetDataTable2Dst016()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("no", typeof(string));
            dt.Columns.Add("name", typeof(string));
            dt.Columns.Add("value", typeof(int));
            dt.Rows.Add("S0001", "あんぱん", 100);
            dt.Rows.Add("S0002", "メロンパン", 150);
            dt.Rows.Add("S0003", "カレーパン", 110);
            dt.Rows.Add("S0004", "いちごジャムパン", 115);
            dt.Rows.Add("S0005", "コロネ", 120);
            dt.Rows.Add("S0006", "クロワッサン", 125);
            dt.Rows.Add("S0007", "クリームパン", 130);
            return dt;
        }
 |