[OperationContract] public List<projectgantt> Select(int reference) { List<projectgantt> list = new List<projectgantt>(); using (SqlConnection con = new SqlConnection(conn)) { string query = "SELECT ganttDescription, ganttStartDate, ganttEndDate, ganttDuration, ganttPredecessor, ganttProgress, ganttResources FROM dbo.ProjectGantt"; using (SqlCommand cmd = new SqlCommand(query, con)) { con.Open(); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { ProjectGantt t = new ProjectGantt(); t.ganttDescription = reader.GetValue(0).ToString(); t.ganttStartDate = reader.GetValue(1).ToString(); t.ganttEndDate = reader.GetValue(2).ToString(); t.ganttDuration = reader.GetValue(3).ToString(); t.ganttPredecessor = reader.GetValue(4).ToString(); t.ganttProgress = reader.GetValue(5).ToString(); t.ganttResources = reader.GetValue(6).ToString(); list.Add(t); } } } } return list; }
void Proxy_SelectCompleted(object sender, SelectCompletedEventArgs e) { GanttChartDataGrid.ItemsSource = e.Result; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)