Appajee,
Tried that and it still failed. What is even more weird to me is that
when I do "Go To Definition" in the context menu and retrieve the
metadata for EntryFieldValueList I get this (which doesn't have Item):
using System;
using System.Collections;
using System.Reflection;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
// Summary:
// A collection of elements of type EntryFieldValue
[ClassInterface(2)]
[ProgId("BMC.ARSystem.EntryFieldValueList")]
public class EntryFieldValueList : CollectionBase
{
// Summary:
// Initializes a new empty instance of the
EntryFieldValueList class.
public EntryFieldValueList();
// Summary:
// Gets or sets the EntryFieldValue at the given index in
this EntryFieldValueList.
public virtual EntryFieldValue this[int index] { get; }
// Summary:
// Adds an instance of type EntryFieldValue to the end of
this EntryFieldValueList.
//
// Parameters:
// value:
// The EntryFieldValue to be added to the end of this
EntryFieldValueList.
public virtual void Add(EntryFieldValue value);
//
// Summary:
// Determines whether a specfic EntryFieldValue value is
in this EntryFieldValueList.
//
// Parameters:
// value:
// The EntryFieldValue value to locate in this
EntryFieldValueList.
//
// Returns:
// true if value is found in this EntryFieldValueList;
false otherwise.
public virtual bool Contains(EntryFieldValue value);
//
// Summary:
// Returns an enumerator that can iterate through the
elements of this EntryFieldValueList.
//
// Returns:
// An object that implements
System.Collections.IEnumerator.
public virtual EntryFieldValueList.Enumerator GetEnumerator();
//
// Summary:
// Return the zero-based index of the first occurrence of
a specific value in
// this EntryFieldValueList
//
// Parameters:
// value:
// The EntryFieldValue value to locate in the
EntryFieldValueList.
//
// Returns:
// The zero-based index of the first occurrence of the
_ELEMENT value if found;
// -1 otherwise.
public virtual int IndexOf(EntryFieldValue value);
// Summary:
// Type-specific enumeration class, used by
EntryFieldValueList.GetEnumerator.
public class Enumerator : IEnumerator
{
// Summary:
// Constructs a new object
//
// Parameters:
// collection:
public Enumerator(EntryFieldValueList collection);
// Summary:
// Current
public EntryFieldValue Current { get; }
// Summary:
// Move next
public bool MoveNext();
//
// Summary:
// Reset
public void Reset();
}
}
}
I guess now my question is how do I enumerate the returned data
without item?
On Jul 23, 11:34 am, "Papolu, Appajee" <[EMAIL PROTECTED]> wrote:
> Instead of "Item(i)", try doing "[i]" as in...
> string entryID = efvl[i].EntryID;
>
> Regards
> Appajee
>
> -----Original Message-----
> From: Action Request System discussion list(ARSList)
>
> [mailto:[EMAIL PROTECTED] On Behalf Of bswrchrd
> Sent: Sunday, July 22, 2007 8:57 PM
> To: [EMAIL PROTECTED]
> Subject: Question about EntryFieldValueList
>
> I am newbie and trying to display the values in the fields associated
> with a entryfieldvaluelist using the following C# code:
>
> using System;
> using System.Collections.Generic;
> using System.Text;
> using BMC.ARSystem;
> using BMC.ARSystem.Utilities.Common;
>
> namespace BMC.ARSystem
> {
> public class Search
> {
> static void Main(string[] args)
> {
> if (args.Length == 0)
> {
> Console.WriteLine("No arguments submitted");
> Console.ReadLine();
> return;
> }
>
> String serverName = string.Empty;
> String userName = string.Empty;
> String password = string.Empty;
> String formName = "HPD:Help Desk";
>
> try
> {
> serverName = args[0].ToString(); // first arg-the
> key
> userName = args[1].ToString(); // second arg-the
> value
> password = args[2].ToString(); // third arg-the
> value
> }
> catch
> {
> Console.ReadLine();
> return;
> }
>
> {
> ARSystem.Server ARServer = new ARSystem.Server();
> ARServer.Login(serverName, userName, password, "");
>
> String qual = "1=1";
>
> BMC.ARSystem.EntryListFieldList elfl = new
> BMC.ARSystem.EntryListFieldList();
> elfl.AddField(0);
>
> BMC.ARSystem.EntryFieldValueList efvl = new
> BMC.ARSystem.EntryFieldValueList();
> efvl = ARServer.GetListEntryWithFields(formName, qual,
> elfl, Convert.ToUInt32(0), Convert.ToUInt32(99));
>
> int i = efvl.Count - 1;
> int j;
> for (j = 0; j < i; i += 1)
> {
> string entryID = efvl.Item(i).EntryID;
> Console.WriteLine(entryID);
>
> }
> }
> }
> }
> }
>
> I keep receiving an error :
>
> Error 1 'BMC.ARSystem.EntryFieldValueList' does not contain a
> definition for 'Item' C:\VS2005\Projects\RemedySearch\RemedySearch
> \Program.cs 59 47 RemedySearch
>
> What's weird is that I built a Powershell script that will retrieve
> the data, everything is fine, but I would like to be able to compile
> the code. I know I'm missing something but I can't figure out what is
> it. If anybody can see it TIA.
>
> ________________________________________________________________________
> _______
> UNSUBSCRIBE or access ARSlist Archives atwww.arslist.orgARSlist:"Where
> the Answers Are"
>
> _______________________________________________________________________________
> UNSUBSCRIBE or access ARSlist Archives atwww.arslist.orgARSlist:"Where the
> Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"