帮助从列表项中读取字符串值

帮助从列表项中读取字符串值

本文介绍了帮助从列表项中读取字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SP填充下面的列表项''GetStagAgtNmbyList'',我试图用SP中返回的AgentNames填充输出

Hi I''ve a SP that is populating the below list item ''GetStagAgtNmbyList'', I am trying to populate output with the AgentNames returned in the SP

private nsDataTypes.GetStgAgtNameOutput marshallToGetStagAgtNmbyList(RecordCollection rcResults,RecordCollection recResults)
        {
            nsDataTypes.GetStgAgtNameOutput output = new nsDataTypes.GetStgAgtNameOutput();
            foreach (Record rec in rcResults)
            {
                nsDataTypes.GetStgAgtNmByAppRecord r = new nsDataTypes.GetStgAgtNmByAppRecord();
                r.AgtName = rec.get_Item(nsWebResources.SprocConstants.AGT_AGENT_NM).ToString();
                output.GetStagAgtNmbyList.Add(r);
            }
            return output;
        }





以下变量未分配AgentName:



The below variable is not being assigned the AgentName:

tempStagerAgentName = Output.Staging_AgtNm.ToString();





如何获取Output.GetStagAgtNmbyList中包含的AgentName值tempStagerAgentName?



How do i get the AgentName values contained in Output.GetStagAgtNmbyList to be in tempStagerAgentName?

推荐答案

//Creating New Hashtable and adding key and values for staging agents name through List Collection
            System.Collections.Hashtable StagingAgtTaskCntbyht = new System.Collections.Hashtable();

            for (var i = 0; i < output.GetStagAgtNmbyList.Count; i++)
            {
                StagingAgtTaskCntbyht.Add(output.GetStagAgtNmbyList[i].AgtName, 0);
            }


这篇关于帮助从列表项中读取字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 01:38