Ich habe ein kleines Problem, möchte zwar 2 Tabelle, Spalte "KundenName" anhand DataRelation oder Linq verknüpfen.
Hier ist mein Code:
Kann mir jemand beibringen wie es weiter mit Relation oder Linq machen kann. Ich bin sehr dankbar
Hier ist mein Code:
Code:
DataTable table = new DataTable("Kunde");
table.Columns.Add("KundeID", typeof(Int32));
table.Columns.Add("KundeName", typeof(String));
table.Columns.Add("Produkt", typeof(String));
table.PrimaryKey = new DataColumn[] { table.Columns["KundeID"] };
DataTable comment = new DataTable("Comment");
comment.Columns.Add("KundeName", typeof(String));
comment.Columns.Add("Comment", typeof(String));
comment.PrimaryKey = new DataColumn[] { comment.Columns["KundeName"] };
DataSet ds = new DataSet("DataSet");
ds.Tables.Add(table);
ds.Tables.Add(comment);
object[] o1 = { 1, "Michael", "Jogurt" };
object[] o2 = { 2, "Raj", "Cola" };
object[] o3 = { 3, "Gary", "Fanta" };
object[] c1 = { "Raj", "Ich bin cool" };
object[] c2 = { "Gary", "yahoo" };
object[] c3 = { "Michael", "nichts zu verlieren" };
comment.Rows.Add(c1);
comment.Rows.Add(c2);
comment.Rows.Add(c3);
table.Rows.Add(o1);
table.Rows.Add(o2);
table.Rows.Add(o3);
Kann mir jemand beibringen wie es weiter mit Relation oder Linq machen kann. Ich bin sehr dankbar
Zuletzt bearbeitet: