Hi all,
please help me with this:
How to View the "INNER JOIN" in C#
for example
Customer(CustomerID, CustomerName)
Order(OrderID, CustomerID, OrderDate, OrderAmount)
A list of customer who made order of month could be easy collected by SQL query as below:
select C.CustomerID, C.CustomerName, O.OrderAmount
from Customer C join on Order O (C.CustomerID = O.Customer ID)
where Month(O.OrderDate) = month(getdate())
who can I do it in Dataset? for display purpose
Dataset dsCustomerOrder = new Dataset("CustomerOrder");
DataTable dtCustomer = ....;
DataTable dtOrder = ...;
dsCustomerOrder.Tables.Add(dtCustomer);
dsCustomerOrder.Tables.Add(dtOrder);
DataRelation drCustomerOrder = new DataRelation("R_CustomerOrder", dtCustomer.Columns["CustomerID"], dtOrder.Columns["CustomerID"];
...............
I want to bind it to DataGird with following columns: CustomerID, CustomerName, CustomerOrder
Thank you
Looking forward to hearing for all you guys!
!--removed tag-->
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).