public void LoadQAndA(string id, string type) { StudioMResource.QandAForSupplier qa; StudioMQandA.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_LoadStudioMAttributeForClusterOrGroup(id, type, DefaultStateID.ToString()); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { qa = new StudioMResource.QandAForSupplier(); qa.SupplierBrandID = int.Parse(dr["idStudioMSupplier"].ToString()); qa.SupplierBrandName = dr["SupplierName"].ToString(); qa.QuestionID = int.Parse(dr["idTemplateQuestion"].ToString()); qa.QuestionText = dr["Question"].ToString(); if (bool.Parse(dr["mandatory"].ToString())) { qa.Mandatory = true; } else { qa.Mandatory = false; } qa.AnswerType = dr["AnswerType"].ToString(); qa.AnswerID = int.Parse(dr["idTemplateAnswer"].ToString()); qa.AnswerText = dr["Answer"].ToString(); StudioMQandA.Add(qa); } }