C#  

System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter();

System.Data.OleDb.OleDbCommand select = new System.Data.OleDb.OleDbCommand();

System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();

DataSet data = new DataSet();

 

connection.ConnectionString = DatabaseTools.GetNorthwindConnectionString();

 

select.CommandText = @"SELECT Orders.OrderDate, Customers.CompanyName, Products.ProductName, [Order Details].Quantity * [Order Details].UnitPrice AS ProductAmount FROM (((Orders INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID) INNER JOIN Products ON [Order Details].ProductID = Products.ProductID) ORDER BY OrderDate";

 

select.Connection = connection;

 

adapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {

new System.Data.Common.DataTableMapping("Table", "Orders", new System.Data.Common.DataColumnMapping[] {