5
Answers

c# ADO.NET

Ilkin Turk

Ilkin Turk

11y
1.4k
1
Hello.

Below I showed my example where i try to add first table field values   to secodn table. According to second table column name.Want to say , if first table FIELD_ID = second table column name then add.if any idea help please

            DataTable dt = new DataTable();
            dt.Columns.Add("Field_ID", typeof(Int32));
            dt.Columns.Add("Field", typeof(String));
            dt.Rows.Add(new object[] { 1, "Masin" });
            dt.Rows.Add(new object[] { 2, "Tank" });
            dt.Rows.Add(new object[] { 3, "Helicopter" });

            DataTable dt2 = new DataTable();
            dt2.Columns.Add("1", typeof(String));
            dt2.Columns.Add("2", typeof(String));

Thanks in advance.
Answers (5)