Visual Studio 2010 - (Windows Forms) in C#
I have this code:
private void cbxValuta_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
string primo = cbxValuta.SelectedItem.ToString();
string secondo = cbxValuta2.SelectedItem.ToString();
double cambio = double.Parse(CurrencyConverter.Convert(1.0m, primo, secondo));
tbxConvertito.Text = (double.Parse(tbxDaConvertire.Text) * cambio).ToString();
I get this error:
NullReferenceException was unhandled Object reference not set to an instance of an object.
How Can I solve this issue?