validateDept.InitializeConnection(); OleDbConnection connection = new OleDbConnection(validateDept.connetionString); OleDbDataAdapter AdapterCustomers = new OleDbDataAdapter( "SELECT EmployeeId, FirstName FROM Employee", connection); OleDbDataAdapter AdapterInvoices = new OleDbDataAdapter( "SELECT InvoiceId, InvoiceNumber, InvoiceDate, SalesPerson AS EmployeeId, Customername AS CustomerId, (Select CustomerName from Customer where Customer.CustomerId = NewInvoice_1.CustomerName) AS Customer_Name, DueDate, Tax, GrandTotal, CompanyId, InvoiceStatus FROM NewInvoice_1", connection); DataSet dataSet11 = new DataSet(); //Create DataTable objects for representing database's tables AdapterCustomers.Fill(dataSet11, "Employee"); AdapterInvoices.Fill(dataSet11, "Invoices"); //Set up a master-detail relationship between the DataTables DataColumn keyColumn = dataSet11.Tables["Employee"].Columns["EmployeeId"]; DataColumn foreignKeyColumn = dataSet11.Tables["Invoices"].Columns["EmployeeId"]; dataSet11.Relations.Add("CustomerInvoice", keyColumn, foreignKeyColumn); // Getting error on this row //Bind the grid control to the data source gridControl1.DataSource = dataSet11.Tables["Employee"]; gridControl1.ForceInitialize(); //Assign a CardView to the relationship GridView cardView1 = new GridView(gridControl1); gridControl1.LevelTree.Nodes.Add("CustomerInvoice", cardView1); //Specify text to be displayed within detail tabs. cardView1.ViewCaption = "Invoice List of a Customer"; //Create columns for the detail pattern View cardView1.PopulateColumns(dataSet11.Tables["Invoices"]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)