0
votes

I have a desktop app (winforms) with an embedded Local Database SQL CE .

I have 2 tables in my database: Customers and Orders.

In Customers table I have : customerID , customerName.

In Orders table I have : CustomerID , OrderID, OrderName.

I want to display a report with : CustomerID , CustomerName , OrderName.

How can I get the value for customerName that matches the customerID in ordersTable.

Any help would be appriciated.

2

2 Answers

0
votes
SELECT Customers.CustomerID, Customers.CustomersName, Orders.OrderName
FROM Customers
INNER JOIN Orders
ON Customers.CustomerID=Orders.CustomerID;
0
votes

If you're using local report (*.rdlc types) it is not possible to set custom query for report. you can create a report table and insert searched records in it and make a local report for report table!! or use dynamic query dataset.

I had this problem before: see more