public void LoadAnswer(string questiontext, string answertext, int active, int pstateid) { Answer s; StudioMAnswer.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetAnswerList(questiontext, answertext, active, pstateid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new Answer(); s.AnswerID = int.Parse(dr["idtemplateanswer"].ToString()); s.AnswerText = dr["answer"].ToString(); s.QuestionID = int.Parse(dr["fkidtemplatequestion"].ToString()); s.QuestionText = dr["question"].ToString(); s.AnswerTypeText = dr["answertype"].ToString(); s.Active = bool.Parse(dr["active"].ToString()); StudioMAnswer.Add(s); } LoadQuestions("", 1, pstateid); }