Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enumerator Current property

Status
Not open for further replies.

maneland

Programmer
Mar 24, 2006
24
ES
I'm using the example below:

ArrayList arrayList = new ArrayList(countryArray.Keys);
IEnumerator listEnumerator = arrayList.GetEnumerator();
while (listEnumerator.MoveNext())
{
dr = dt.NewRow();
codeInt = getHBDestCode(listEnumerator.Current);
...


The getHBDestCode() function is:
private int getHBDestCode(string codeHB)
{
...

I´m getting this error:

CS1502: The best overloaded method match for 'ASP.destinations_aspx.getHBDestCode(string)' has some invalid arguments

What is wrong?
 
As a start, maybe you should try acknowledging some of the answers you have been given in previous posts and then read the FAQ in my signature on how to get the best out of these forums (specifically point 15).

As for your problem, is istEnumerator.Current a String like your function accepts?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I would like to convert the Enumerator.Current to String in order to use it as parameter of the getHBDestCode function.

Thanks in advance
 
So use the ToString method...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yes. I was tying but I get this error:

CS1502: The best overloaded method match for 'ASP.destinations_aspx.getHBDestCode(string)' has some invalid arguments

Thanks in advance
 
You example code that you have provided doesn't use the ToString method...are you using different code to what you actually posted above?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
This is the example I´m using now:

ArrayList arrayList = new ArrayList(countryArray.Keys);
IEnumerator listEnumerator = arrayList.GetEnumerator();
while (listEnumerator.MoveNext())
{
dr = dt.NewRow();
codeInt = getHBDestCode(listEnumerator.Current.ToString());
...........

The funtion declaration:
private int getHBDestCode(string codeHB)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top