sábado, diciembre 21, 2024
Inicio C# Hacer Joins entre DataTables

Hacer Joins entre DataTables

0
[VB.NET]

'Creamos el Dataset
Dim ds as new DataSet()

'Agregamos las ralaciones
ds.Relations.Add("Customers_Orders",
ds.Tables("Customers").Columns("CustomerID"),
ds.Tables("Orders").Columns("CustomerID")

'Otra relación
ds.Relations.Add("Orders_Products",
ds.Tables("Orders").Columns("ProductID"),
ds.Tables("Products").Columns("ProductID")

ds.Relations("Customer_Orders").Nested = true
ds.Relations("Orders_Products").Nested = true
[C#.NET]

DataSet ds = new DataSet();
ds.Relations.Add("Customers_Orders", 
ds.Tables("Customers").Columns("CustomerID"), 
ds.Tables("Orders").Columns("CustomerID"));

ds.Relations.Add("Orders_Products", 
ds.Tables("Orders").Columns("ProductID"), 
ds.Tables("Products").Columns("ProductID"));

ds.Relations("Customer_Orders").Nested = true;
ds.Relations("Orders_Products").Nested = true;

Fuente Foros del Web

Dejar respuesta

Please enter your comment!
Please enter your name here