I have included following webservice in my project

http://www.webservicex.net/CurrencyConvertor.asmx

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);
lblResult.text=Rate.toString();

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);
lblResult.text=Rate.toString();

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....

Thanks,
Vaibhav Deshpande

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.