Torna al Thread
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim venditore As String
venditore = ComboBox1.Text
sql = "SELECT da,a,utente FROM agenda WHERE utente = '" & venditore & "'"
Dim dataadapter As New SqlDataAdapter(sql, cnn)
Dim ds As New DataSet()
Dim dt As New DataTable
cnn.Open()
dataadapter.Fill(ds, "agenda")
Dim dr As DataRow
For Each dr In ds.Tables("agenda").Rows
Dim app As New Appointment()
app.StartDate = dr("da")
app.EndDate = dr("a")
app.Subject = "Appuntamento del " & app.StartDate
listaAppuntamenti.Add(app)
DayView1.Invalidate()
Next
cnn.Close()