Hello people,
I have made following code,
I wonder how do I change the Handles to display the result from my query immediately?
see code below:
Could someone help me ?
Thank you in advance
I have made following code,
I wonder how do I change the Handles to display the result from my query immediately?
see code below:
Code:
Private Sub Cbx_Year_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cbx_Year.SelectedIndexChanged
Dim Combobox As ComboBox = CType(sender, ComboBox)
If Cbx_Year.SelectedItem IsNot Nothing Then
Dim CurrentVal = CType(Cbx_Year.SelectedItem, String)
' MsgBox(CurrentVal)
End If
Dim Year_List_HashTable As New List(Of Integer)
Dim Years_list As List(Of Integer)
Dim dt As New DataTable()
Dim dv As New DataView(dt)
Dim ConnectionString As String = "Data Source=ttdev\Teknotrans_dev;Initial Catalog=myDatabase;Integrated Security=True"
Dim myconn As New SqlConnection(ConnectionString)
myconn.Open()
Using da As New SqlDataAdapter("SELECT DISTINCT [t0].[bestdatum] AS [Bestdatum]FROM [OpusOrder] AS [t0]", myconn)
da.Fill(dt)
End Using
myconn.Close()
Dim Years_Table As DataTable = dv.ToTable(True, "Bestdatum") ' tabellen ur databasen samt kolumen med datan
For Each customer As DataRow In Years_Table.Rows
Dim Year_Item = (customer("Bestdatum").ToString)
Dim Year_String As String = (Year_Item.Substring(0, Year_Item.Length - 15))
Year_List_HashTable.Add(Year_String)
Next
Years_list = Year_List_HashTable.Distinct().ToList ' Ta bort dubletter
Years_list.Sort()
For Each item In Years_list
Cbx_Year.Items.Add(item)
Next
Cbx_Year.SelectedIndex = 0
End Sub
Could someone help me ?
Thank you in advance