Torna al Thread
Dim MyConnection As New SqlConnection(WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Dim sqlAd1 As New SqlClient.SqlDataAdapter("SELECT Codfisc, Dal, Al FROM Ferie where codfisc = '" & HiddenField1.Value & "' and ('" & TextBox1.Text & "' between dal and al ) and ('" & TextBox2.Text & "' between dal and al)", MyConnection)
Dim dv As New DataView
' creo il dataset con i dati del data adapter
Dim Ds1 As New DataSet
sqlAd1.Fill(Ds1, "Ferie")
dv.Table = Ds1.Tables("Ferie")
' popolo il dataset
' associo il data set alla gridview
GridView2.DataSource = dv
dv.RowFilter = "Codfisc = '" & HiddenField1.Value & "'"
GridView2.DataBind()