Click here to Skip to main content
15,902,892 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there.

I am trying to get the selected data from the database through a webservice to a silverlight gantt control. Data items show on the grid but the data is not visible in those items. I don't know what the problem is. Here is a sample:

* Select Statement:

C#
[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;
        }
* Webservice call method

C#
void Proxy_SelectCompleted(object sender, SelectCompletedEventArgs e)
        {
            GanttChartDataGrid.ItemsSource = e.Result;
        }


Could please you help me resolve this problem. Immediate response would be very much appreciated.

Thank you
Kholisa.
Posted
Updated 21-Jun-12 2:34am
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900