troubleshooting Question

How do i convert arraylist to List<Dictionary<string, string>>

Avatar of Lalu01
Lalu01 asked on
C#
4 Comments1 Solution3758 ViewsLast Modified:
Hello,
The following is the code from my service.  I need to convert arraylist into
Dictionary<string, string>. The arraylist is in key/value.

E.g. Sample arraylist as follows:

array list (0): "UserID"
array list (1): "Tom"
array list (2): "ActivityName"
array list (3): "Login"

*********  Service code *********************
  public class Service1 : System.Web.Services.WebService
    {

        protected List<Dictionary<string, string>> list;
        protected String activityname;
       
        [WebMethod]
        public void WriteToBam(string ActivityName, object[] arrObj)
        {
             ArrayList arrDB = new ArrayList(ar rObj);
            // Load the value from arraylist to Dictionary (key/value)

             BAMWriter bamWriter = new BAMWriter();
            bamWriter.writeToBamDatabase(list, ActivityName);
        }
    }

Thanks in advance
ASKER CERTIFIED SOLUTION
Thejaka

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros