public void LoadQuestions(string question, int active, int pstateid) { Question s; StudioMQuestion.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetQuestionList(question, active, pstateid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new Question(); s.QuestionID = int.Parse(dr["idtemplatequestion"].ToString()); s.QuestionText = dr["question"].ToString(); s.AnswerTypeID = int.Parse(dr["fkidanswertype"].ToString()); s.AnswertypeText = dr["answerType"].ToString(); s.Active = bool.Parse(dr["active"].ToString()); s.QuestionAndType = dr["questionandtype"].ToString(); s.QuestionStateID = int.Parse(dr["fkidstate"].ToString()); s.Mandatory = bool.Parse(dr["Mandatory"].ToString()); StudioMQuestion.Add(s); } }