private void btnLeggiRegMag_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { string azienda = (string)ddlAziende.SelectedItem; BCServices bc = new BCServices(); bc.CreaConnessione(azienda); List <RegMesWS> righe = bc.EstraiRegMag(); txtMessaggio.Text = string.Format("Operazione terminata con successo. Trovate {0} righe", righe.Count); } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }