Torna al Thread

Sub crea_form() risultato.Visible = True gv.Visible = False form_blocco.Visible = True operazione.Text = "ins" Dim s As String = "" Try Dim conn As New SqlConnection("Data Source=PC-MAURIZIO; Initial Catalog=NOTIFICHE;Integrated Security=SSPI") Dim command1 As New SqlCommand("select loc_codice, loc_comune from localita", conn) conn.Open() Dim dr As SqlDataReader = command1.ExecuteReader() comune.DataSource = dr comune.DataBind() dr.Close() Catch ex As Exception 'qui ho costruito una stringa con il messaggio di errore e i suoi dettagli, ma puoi benissimo personalizzarlo, anche solo scrivendo "Errore nel caricamento": vedi tu s = ex.Message s += "<br/>" s += ex.StackTrace visualizzaMessaggio(s) End Try End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5