I have included following webservice in my project


There i got a function as ConversionRate() which takes parameters as follws

double Rate;
CurrencyConvertor ccs = new CurrencyConvertor();
Rate= ccs.ConversionRate(Currency.USD, Currency.INR);

It works fine but, My application contains 2 textboxes where i want to manually show the conversion rates

I want to do as follows

Rate= ccs.ConversionRate(txtFromCurrency.text, txtToCurrency.text);

so that application should atomatically convert rates and show in the lable

but ConversionRate() takes arguments as Currency.(Name of Currency)

Is there any method to send these textbox parameters to the function?

What were you planning to put in your textboxes?

As you said, the method ConversionRate takes two numeric arguments representing each country.

From all 2 text boxes i wanted country and in the lable i wanted the currency rate as follows

txtbox1 USD
txtbox2 INR

On submit

Lable 45.0

which is solved by typecasting the class Currency sense it was ENUM
i have type cast it using ENUM and problem solved....

Vaibhav Deshpande