Click here to Skip to main content
13,193,829 members (56,031 online)
Rate this:
Please Sign up or sign in to vote.
See more:
private List<getWorkDetails> getWorkInfo(string WorkCenter, string Item)
            List<getWorkDetails> x = new List<getWorkDetails>();
            string sqlGetTimes = "select start_date, completion_date, complete_quantity from dr_dc_schedule where is_complete = '1' and workcenter_id = '" + WorkCenter + "' and start_date > '" + startValue + "' and start_date < '" + endValue + "' and item_id = '" + Item + "' ";
            OracleCommand getTimes = new OracleCommand(sqlGetTimes, connShop);
            OracleDataReader readTimes1 = getTimes.ExecuteReader();
            using (readTimes1)
                DataTable table = new DataTable();
                table.TableName = "Krysiaa"; // Apparantly I need a name to assign a table..
                dvNewDataViewObject.Table = table;
            OracleDataReader readTimes2 = getTimes.ExecuteReader();
            TabItem t = new TabItem();
            t.Header = Item;
            t.Name = "itm" + Item;
            DataGrid dg = new DataGrid();
            dg.Name = "dg" + Item;
            dg.ItemsSource = dvNewDataViewObject;
            t.Content = dg;
            TabContAroundPerformGrid.Items.Insert((TabContAroundPerformGrid.Items.Count-1), t);

I have a function that does two things (bad I know). First, its responsibility is to return a List of getWorkDetails, which is a class of mine (poor naming :/ ). Secondly, it needs to pull data from an SQL statement, and add a tab to a tabcontrol of mine and insert a datagrid (with my sql pull info) into that tab.

The problem is, the tabs are created fine, with good headers. The problem is each tab has the same datagrid info! From the final SQL pull. Does anyone have any idea why the final sql pull is always showing up in ALL the tab controls?

If anyone has any ideas and needs further clarification. Let me know.
Posted 19-Feb-13 6:27am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171018.2 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100