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();
DataTable table = new DataTable();
table.TableName = "Krysiaa"; table.Load(readTimes1);
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;
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.